[wp-trac] [WordPress Trac] #32240: /theme-compat/header.php loads images from Kubrick in header, causing 404s if not using Kubrick

WordPress Trac noreply at wordpress.org
Thu May 7 04:55:06 UTC 2015


#32240: /theme-compat/header.php loads images from Kubrick in header, causing 404s
if not using Kubrick
----------------------------------------+------------------------------
 Reporter:  Shelob9                     |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Themes                      |     Version:  1.2
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  ui, template
----------------------------------------+------------------------------

Comment (by Shelob9):

 @Mte90 No theme ''should'' be doing this, but if you create a theme
 without a header.php file, and then use `get_header()` it will pull in the
 `/theme-compat/header.php` file, which has references to image files that
 are in the Kubrick theme.

 My problem with checking if Kubrick is the theme is that you can't do so
 reliably.  `get_stylesheet()` is effectively a reference to the name of
 the directory that contains the active theme. If I install Kubrick in a
 directory called hats, then `get_stylesheet()` will return hats, not
 Kubrick, even though I'm using Kubrick.

 In my opinion, the only reliable way to fix this issue, is to use a
 `file_exists()` or similar for 3 reasons:
 1) The reason I just gave.
 2) If Kubrick is in use, the file still could have been deleted.
 3) A theme besides Kubrick could have that file in it, and be counting on
 it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32240#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list