[wp-trac] Re: [WordPress Trac] #4499: Equality checks in query.php
can break permalinks
WordPress Trac
wp-trac at lists.automattic.com
Wed Jun 20 19:39:48 GMT 2007
#4499: Equality checks in query.php can break permalinks
-----------------------+----------------------------------------------------
Reporter: agharbeia | Owner: anonymous
Type: defect | Status: new
Priority: high | Milestone: 2.3 (trunk)
Component: General | Version: 2.2
Severity: major | Resolution:
Keywords: |
-----------------------+----------------------------------------------------
Changes (by Otto42):
* priority: normal => high
* severity: normal => major
* summary: permalink unresolvable when it consists solely of date/time
elements => Equality checks in query.php can
break permalinks
Comment:
This is due to all the instances in query.php where it's checking for
things like this:
{{{
if ( '' != $q['hour'] ) ...
}}}
The empty string == zero, in php. Evidence:
{{{
<?php if ('' == 0) echo "equal"; else echo "not equal"; ?>
}}}
All these checks need to be changed from != to !== in order to test for
identity instead of equality.
Note that he would get the same result for minute == 0 or second == 0 as
well. There are also possibly other equality checks that can result in
broken links like this.
--
Ticket URL: <http://trac.wordpress.org/ticket/4499#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list