WordPress.org

Make WordPress Core

Ticket #16754: 18999.diff

File 18999.diff, 1.2 KB (added by crrobi01, 10 years ago)
  • wp-includes/formatting.php

     
    13151315 * @return string Converted email address.
    13161316 */
    13171317function antispambot($emailaddy, $mailto=0) {
    1318         $emailNOSPAMaddy = '';
    1319         srand ((float) microtime() * 1000000);
    1320         for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) {
    1321                 $j = floor(rand(0, 1+$mailto));
     1318        $email_no_spam_addy = '';
     1319        for ($i = 0; $i < strlen($emailaddy); $i++) {
     1320                $j = rand(0, 1+$mailto);
    13221321                if ($j==0) {
    1323                         $emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';';
     1322                        $email_no_spam_addy .= '&#'.ord(substr($emailaddy,$i,1)).';';
    13241323                } elseif ($j==1) {
    1325                         $emailNOSPAMaddy .= substr($emailaddy,$i,1);
     1324                        $email_no_spam_addy .= substr($emailaddy,$i,1);
    13261325                } elseif ($j==2) {
    1327                         $emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2);
     1326                        $email_no_spam_addy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2);
    13281327                }
    13291328        }
    1330         $emailNOSPAMaddy = str_replace('@','&#64;',$emailNOSPAMaddy);
    1331         return $emailNOSPAMaddy;
     1329        $email_no_spam_addy = str_replace('@','&#64;',$email_no_spam_addy);
     1330        return $email_no_spam_addy;
    13321331}
    13331332
    13341333/**