Changeset 25055
- Timestamp:
- 08/20/2013 06:07:50 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r25054 r25055 1484 1484 * @since 0.71 1485 1485 * 1486 * @param string $email addyEmail address.1487 * @param int $ mailtoOptional. Range from 0 to 1. Used for encoding.1486 * @param string $email_address Email address. 1487 * @param int $extra_entrpoy Optional. Range from 0 to 1. Used for encoding. 1488 1488 * @return string Converted email address. 1489 1489 */ 1490 function antispambot($emailaddy, $mailto=0) { 1491 $emailNOSPAMaddy = ''; 1492 srand ((float) microtime() * 1000000); 1493 for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) { 1494 $j = floor(rand(0, 1+$mailto)); 1495 if ($j==0) { 1496 $emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';'; 1497 } elseif ($j==1) { 1498 $emailNOSPAMaddy .= substr($emailaddy,$i,1); 1499 } elseif ($j==2) { 1500 $emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2); 1490 function antispambot( $email_address, $extra_entropy = 0 ) { 1491 $email_no_spam_address = ''; 1492 for ( $i = 0; $i < strlen( $email_address ); $i++ ) { 1493 $j = rand( 0, 1 + $extra_entropy ); 1494 if ( $j == 0 ) { 1495 $email_no_spam_address .= '&#' . ord( substr( $email_address, $i, 1 ) ) . ';'; 1496 } elseif ( $j == 1 ) { 1497 $email_no_spam_address .= substr( $email_address, $i, 1 ); 1498 } elseif ( $j == 2 ) { 1499 $email_no_spam_address .= '%' . zeroise( dechex( ord( substr( $email_address, $i, 1 ) ) ), 2 ); 1501 1500 } 1502 1501 } 1503 $emailNOSPAMaddy = str_replace('@','@',$emailNOSPAMaddy); 1504 return $emailNOSPAMaddy; 1502 1503 $email_no_spam_address = str_replace( '@', '@', $email_no_spam_address ); 1504 1505 return $email_no_spam_address; 1505 1506 } 1506 1507
Note: See TracChangeset
for help on using the changeset viewer.