[wp-trac] [WordPress Trac] #15178: Empty endpoint same as missing endpoint: empty vs isset query_var.

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 7 20:13:54 UTC 2011


#15178: Empty endpoint same as missing endpoint: empty vs isset query_var.
------------------------------------+--------------------------
 Reporter:  5ubliminal              |       Owner:  johnbillion
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:
Component:  Query                   |     Version:  3.0.1
 Severity:  normal                  |  Resolution:  duplicate
 Keywords:  has-patch dev-feedback  |
------------------------------------+--------------------------

Comment (by johnbillion):

 Interesting points nacin. The problem is indeed with `WP_Query->get()`
 (and `get_query_var()`).

 The return value of string true in my patch was intentional. It removed
 the ambiguity with values of a non-empty endpoint (eg. if '1' was used
 instead of 'true'), and would be consistent with the value of
 `?my_endpoint=true` if rewrites weren't enabled. A moot point though.

 +1 for changing `WP_Query->get()` so it returns boolean false for unset
 query vars, and/or introducing an `exists()` method.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15178#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list