Re: Bug in digest_md5_parse_challenge

"Pablo Álvarez de Sotomayor Posadillo" <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
    Paul> The reason I chose !== was because with stable code, we need
    Paul> to treat the rest of the code as a black box and touch as
    Paul> little as we can with any changes, and the !== means it will
    Paul> only test for a single condition (the one initially
    Paul> identified, where base64_decode() returns specifically
    Paul> FALSE), whereas != can catch any other value that can be
    Paul> evaluated as FALSE such as 0, "", array(), and "0".  It is
    Paul> not good to make assumptions about the meaning of those
    Paul> other possible values.

    Paul> So, if we continue on that track, we'd have to add another
    Paul> type-specific check, but I'm now going to step away from the
    Paul> black box approach and look inside the loop, where we can
    Paul> see that it is clear that any of the other types that can be
    Paul> cast as boolean FALSE are not expected therein.  Therefore,
    Paul> the better solution is (and please, if you don't mind, test
    Paul> this and let us know if it works OK):

    Paul>     while (!empty($challenge)) {

Yes, it's work ok. I'm agree with you in the reasoning, and clearly the
best solution is that.

Regards

-- 
    Pablo Álvarez de Sotomayor Posadillo
Ingeniero Técnico en Informática de Sistemas
	    http://ritho.net
 "De todas las cosas que he perdido la que 
     mas hecho de menos es mi cerebro"

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.