[geeklog-devtalk] geeklog-devel digest, Vol 1 #510 - 1 msg

geeklog-devel-request at lists.geeklog.net geeklog-devel-request at lists.geeklog.net
Fri Feb 18 13:00:02 EST 2005


Send geeklog-devel mailing list submissions to
geeklog-devel at lists.geeklog.net

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.geeklog.net/listinfo/geeklog-devel
or, via email, send a message with subject or body 'help' to
geeklog-devel-request at lists.geeklog.net

You can reach the person managing the list at
geeklog-devel-admin at lists.geeklog.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of geeklog-devel digest..."


Today's Topics:

1. COM_applyFilter doesn't accept negative numbers (Vincent Furia)

--__--__--

Message: 1
Date: Fri, 18 Feb 2005 11:04:28 -0500
From: Vincent Furia <vfuria at gmail.com>
To: Geeklog Devel <geeklog-devel at lists.geeklog.net>
Subject: [geeklog-devel] COM_applyFilter doesn't accept negative numbers
Reply-To: geeklog-devel at lists.geeklog.net

If you call COM_applyFilter($var, true) you run into a problem if $var
is negative. In that case COM_applyFiler will return 0.

It comes down to this:
if( $isnumeric )
{
// Note: PHP's is_numeric() accepts values like 4e4 as numeric
if( !is_numeric( $p ) || ( preg_match( '/^([0-9]+)$/', $p ) == 0 ))
{
$p = 0;
}
}

Notice the preg_match won't match negative numbers. This is easily
fixed, but I'm not quite sure why is_numeric by itself isn't
sufficient. Is there any problem if we allow numbers like 4e4 to be
accepted?

I found this because it is breaking the ability to change comment
display modes in pollbooth.php.

-Vinny

P.S. Note that I have NOT checked in any fixes for this.


--__--__--

_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-devel


End of geeklog-devel Digest



More information about the geeklog-devtalk mailing list