#9482 closed defect (bug) (fixed)
is_home() returns true for the robots.txt handler
| Reported by: | johnbillion | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7.2 |
| Component: | Canonical | Version: | 2.7.1 |
| Severity: | normal | Keywords: | robots.txt is_robots is_home, is_front_page has-patch |
| Cc: | Focuses: |
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
@
17 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
@
17 years ago
- Keywords robots.txt, is_robots, is_home, is_front_page, has_patch → robots.txt is_robots is_home, is_front_page has_patch
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch