Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
Original comment by daneirac...@gmail.com
on 23 Apr 2011 at 6:53
If you browse from svn version 1.8.3, the undefined $error variable is on line:
1491 while on version 1.8.2 is on line: 1485.
And on the code i downloaded from here the 23 or 22 of April (which should be
version 1.8.2) is on line: 1457.
You can't have:
if ($error) without $error not initialized in php;
In the big switch statement above the if ($error) line, (where you switch on
user actions) if there is no error then the $error variable is never set to
true or false.
so PHP throws an E_NOTICE.
I am attaching 2 screen-shots, 02 is a screen-shot of the code i downloaded
from here, screen-shot 03 is a screen-shot of version 1.8.3 from browsing your
svn, and also i am attaching the code i have download from here.
hope the above helps
cheers
_andrea
Original comment by sci...@gmail.com
on 23 Apr 2011 at 8:50
Attachments:
This should now be fixed. I changed the line to simply:
if(isset($error))
Original comment by daneirac...@gmail.com
on 23 Apr 2011 at 10:43
Hi,
sorry i don't mean to be pedantic but:
the reason for doing if (isset($error) && $error) rather then simply if
(isset($error)), is that if someone decides to initialize the $error variable
at the top of the block, then your if (isset($error)) will return true even if
$error is false, so your fix, fixes a bug but introduces the possibility for
another.
While with the double check you fix it and forget about it, unless the logic
changes.
cheers
_andrea
Original comment by sci...@gmail.com
on 23 Apr 2011 at 11:59
[deleted comment]
Good catch. $error isn't being initialized until an error actually happens, so
as of the current version, $error will never be false. That might change
though, so I think your idea is the way to go. I just fixed it.
Original comment by daneirac...@gmail.com
on 24 Apr 2011 at 1:01
Original issue reported on code.google.com by
sci...@gmail.com
on 23 Apr 2011 at 12:12Attachments: