[wp-trac] [WordPress Trac] #9482: is_home() returns true for the
robots.txt handler
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 8 03:08:06 GMT 2009
#9482: is_home() returns true for the robots.txt handler
--------------------------+-------------------------------------------------
Reporter: johnbillion | Owner: markjaquith
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.7.2
Component: Canonical | Version: 2.7.1
Severity: normal | Keywords: robots.txt, is_robots, is_home, is_front_page
--------------------------+-------------------------------------------------
If your site does not have a robots.txt file and `example.com/robots.txt`
is requested, WordPress kicks in and generates a robots.txt file for you.
The problem is that `is_home()` returns true at this point when it
shouldn't. This can cause problems with plugins/themes that hook into the
`template_redirect` hook and then redirect or alter output based on the
`is_home()` conditional.
The end result is that a site can be outputting a complete page when
`example.com/robots.txt` is requested, instead of the plain robots.txt
file.
Also affects `is_front_page()` where applicable.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9482>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list