From d9bd6e703919ba289a3ccf5c8b60ab5da9af5980 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 28 Aug 2013 01:46:57 +0000 Subject: [PATCH] Use a better variable name in antispambot() introduced with [25055]. Props duck_ Fixes #16754 git-svn-id: https://develop.svn.wordpress.org/trunk@25146 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index f21c72bebe..58b4f9d8fe 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -1484,19 +1484,19 @@ function rawurlencode_deep( $value ) { * @since 0.71 * * @param string $email_address Email address. - * @param int $extra_entropy Optional. Range from 0 to 1. Used for encoding. + * @param int $hex_encoding Optional. Set to 1 to enable hex encoding. * @return string Converted email address. */ -function antispambot( $email_address, $extra_entropy = 0 ) { +function antispambot( $email_address, $hex_encoding = 0 ) { $email_no_spam_address = ''; for ( $i = 0; $i < strlen( $email_address ); $i++ ) { - $j = rand( 0, 1 + $extra_entropy ); + $j = rand( 0, 1 + $hex_encoding ); if ( $j == 0 ) { - $email_no_spam_address .= '&#' . ord( substr( $email_address, $i, 1 ) ) . ';'; + $email_no_spam_address .= '&#' . ord( $email_address[$i] ) . ';'; } elseif ( $j == 1 ) { - $email_no_spam_address .= substr( $email_address, $i, 1 ); + $email_no_spam_address .= $email_address[$i]; } elseif ( $j == 2 ) { - $email_no_spam_address .= '%' . zeroise( dechex( ord( substr( $email_address, $i, 1 ) ) ), 2 ); + $email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[$i] ) ), 2 ); } }