Bug Report

Captcha - Undefined variable: now in core.functions.php

Date: 06/30/2008 Severity: Minor
Status: Resolved Reporter: Robin Sowell
Version: EE 1.6.4 Assigned To: Not Assigned
Keywords: PHP Errors

Details

Around line 1901, $now is only defined inside the conditional- thus throwing an error later if conditional wasn’t true:

if ((mt_rand() % 100) < $SESS->gc_probability)
        
{
            $old
= time() - $expiration;
            
$DB->query("DELETE FROM exp_captcha WHERE date < ".$old);        

            list(
$usec, $sec) = explode(" ", microtime());
            
$now = ((float)$usec + (float)$sec);

Short term- advised to copy

list($usec, $sec) = explode(" ", microtime());
            
$now = ((float)$usec + (float)$sec);

Above the conditional to avoid error.

Comment on Bug Report

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?