Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#26644 closed defect (bug) (worksforme)

Theme screenshots in admin relative to Site Address (URL)

Reported by: diegogb's profile diegogb Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Themes Keywords: reporter-feedback
Focuses: Cc:

Description

The theme screenshots in Appeareance -> themes are relative to eith r the WP Address or the Site Address (URL). This is breaking the images when the Site Address (URL) is not a public URL.
Example of broken link:
http://localhost/wp-content/themes/twentyeleven/screenshot.png

Attachments (2)

localhost http.png (303.4 KB) - added by morganestes 10 years ago.
localhost https.png (326.6 KB) - added by morganestes 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Themes

WP_Theme::get_screenshot() usage has not changed, so doesn't appear to be a regression.

#2 @diegogb
10 years ago

It was working ok with 3.7.1, we were using WordPress HTTPS plugin with URL filters set to / maybe is something that is not updated in the Wordpres HTTPS plugin? If so, we can open a bug there. But it is strange that is taking the screenshot from the WP Address instead of the relative path...

#3 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 3.8.1

Moving for investigation.

#4 @morganestes
10 years ago

  • Keywords reporter-feedback added

@diegogb The default usage of get_screenshot() is to use the absolute URI of the screenshot.ext file that is returned by get_stylesheet_directory_uri(). It's called with the 'relative' parameter in two places in class-wp-theme.php: Line 343 and Line 425, but other than that it should be pulling from whatever is eventually returned by get_theme_root_uri(). Even that is filtered to siteurl, though, which eventually boils down to the "WordPress Address (URL)" setting in admin.

Since core only calls for the relative path in those two places, I'm going to venture a guess that your plugin is filtering out that URL somewhere. I suggest checking on a clean install of the plugin (use define('WPHTTPS_RESET', true); in the plugin itself) and see how that works for you.

#5 @nacin
10 years ago

  • Milestone 3.8.1 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Appears to be invalid.

Note: See TracTickets for help on using tickets.