Changeset 25146
- Timestamp:
- 08/28/2013 01:46:57 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r25058 r25146 1485 1485 * 1486 1486 * @param string $email_address Email address. 1487 * @param int $ extra_entropy Optional. Range from 0 to 1. Used forencoding.1487 * @param int $hex_encoding Optional. Set to 1 to enable hex encoding. 1488 1488 * @return string Converted email address. 1489 1489 */ 1490 function antispambot( $email_address, $ extra_entropy= 0 ) {1490 function antispambot( $email_address, $hex_encoding = 0 ) { 1491 1491 $email_no_spam_address = ''; 1492 1492 for ( $i = 0; $i < strlen( $email_address ); $i++ ) { 1493 $j = rand( 0, 1 + $ extra_entropy);1493 $j = rand( 0, 1 + $hex_encoding ); 1494 1494 if ( $j == 0 ) { 1495 $email_no_spam_address .= '&#' . ord( substr( $email_address, $i, 1 )) . ';';1495 $email_no_spam_address .= '&#' . ord( $email_address[$i] ) . ';'; 1496 1496 } elseif ( $j == 1 ) { 1497 $email_no_spam_address .= substr( $email_address, $i, 1 );1497 $email_no_spam_address .= $email_address[$i]; 1498 1498 } elseif ( $j == 2 ) { 1499 $email_no_spam_address .= '%' . zeroise( dechex( ord( substr( $email_address, $i, 1 )) ), 2 );1499 $email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[$i] ) ), 2 ); 1500 1500 } 1501 1501 }
Note: See TracChangeset
for help on using the changeset viewer.