WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 3 weeks ago

#25394 closed defect (bug) (fixed)

On failure to upload theme, response parses "<",">" to "&lt;","&gt;"

Reported by: adrian.dakota Owned by: nacin
Milestone: 3.9 Priority: lowest
Severity: minor Version: 3.5.2
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

Using the theme upload tool, after uploading a non-valid theme. The HTML response reads:

Unpacking the package…

Installing the theme…

The package could not be installed. The theme is missing the <code>style.css</code> stylesheet.

Theme install failed.

The <code> is parsed and returned as

&lt;code&gt;style.css&lt;/code&gt;

I'm assuming it should be returning

<code>style.css</code>

as HTML, not as text.

Attachments (1)

25394.diff (2.1 KB) - added by JustinSainton 2 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 SergeyBiryukov7 months ago

  • Component changed from General to Upgrade/Install
  • Severity changed from trivial to normal
  • Version changed from 3.6.1 to 3.5.2

JustinSainton2 months ago

comment:2 follow-up: JustinSainton2 months ago

  • Keywords has-patch added

Not sure of the best approach here, but it seems like a feasible one would be to simply remove the <code> tags. Patch attached with that approach.

comment:3 nacin6 weeks ago

  • Milestone changed from Awaiting Review to 3.9

comment:4 in reply to: ↑ 2 samuelsidler3 weeks ago

  • Priority changed from normal to lowest
  • Severity changed from normal to minor

Replying to JustinSainton:

Not sure of the best approach here, but it seems like a feasible one would be to simply remove the <code> tags. Patch attached with that approach.

In a number of places we add <span class="code"> instead of <code> tags. Note that line 1329 has those tags as well for a different error. Might be worth cleaning it up overall.

comment:5 nacin3 weeks ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 27737:

Upgrader skins: Strip tags before displaying error data.

fixes #25394.

Note: See TracTickets for help on using tickets.