#9482 closed defect (bug) (fixed)
is_home() returns true for the robots.txt handler
Reported by: | johnbillion | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 2.7.2 | Priority: | normal |
Severity: | normal | Version: | 2.7.1 |
Component: | Canonical | Keywords: | robots.txt is_robots is_home, is_front_page has-patch |
Focuses: | Cc: |
Description
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.
Attachments (2)
Change History (9)
#2
@
15 years ago
A better location would be in the is_home setter: http://core.trac.wordpress.org/browser/trunk/wp-includes/query.php#L1456
#4
@
15 years ago
- Keywords changed from robots.txt, is_robots, is_home, is_front_page, has_patch to robots.txt is_robots is_home, is_front_page has_patch
Note: See
TracTickets for help on using
tickets.
Patch