[Phpmyadmin-devel] sqlvalidator.lib.php3 is strange?

Robin Johnson robbat2 at orbis-terrarum.net
Thu Aug 29 02:01:02 CEST 2002


On Thu, Aug 29, 2002 at 02:45:20PM +0900, luc wrote:
> Is the line 66 in sqlvalidator.php3 strange?
What do you mean by 'strange' ?

> It never reach to the line 69.
> pear installed.
> 
> if I modify this codes to reject !isset() below
> 
>    if (!$GLOBALS['sqlvalidator_error']) {
>        // create new class instance
>        $srv = new PMA_SQLValidator();  // line 69
> 
> then it reaches to the line 69.
> Why?
> 
> I don't understand.
> Thank you.
If you are using the CVS tree, I just made a change to fix that bug. It
was a logic error that there was a || there instead of &&

It was:
if (!(isset($GLOBALS['sqlvalidator_error'])
      || !$GLOBALS['sqlvalidator_error'])) {
  // create new class instance
  $srv = new PMA_SQLValidator();

Now it is:
if (!(isset($GLOBALS['sqlvalidator_error'])
      && !$GLOBALS['sqlvalidator_error'])) {
  // create new class instance
  $srv = new PMA_SQLValidator();

Because the first case caused a complete evaluation on the globals on my
system, and spat out an error from that.
Notice: Undefined index: sqlvalidator_error in
/home/robbat2/cvs/phpMyAdmin/libraries/sqlvalidator.lib.php3 on line 67

This line was really deceptive, as it really says:
if NOT ( isset($GLOBALS['...']) AND NOT $GLOBALS['...'] )

I'm still not 100% that I have my logic correct their either.

-- 
Robin Hugh Johnson
E-Mail     : robbat2 at orbis-terrarum.net
Home Page  : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ#       : 30269588 or 41961639
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20020829/b84b75bd/attachment.sig>


More information about the Developers mailing list