#9244 closed defect (bug) (fixed)
Hyphen in Theme Directory Breaks Theme Preview
Reported by: | chrisjean | Owned by: | chrisbliss18 |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | trivial | Version: | 2.8 |
Component: | Themes | Keywords: | theme, preview, has-patch |
Focuses: | Cc: |
Description
There is a bug in the regex expressions in the preview_theme() function. The hyphen is not escaped, so themes that have hyphens in the directory name cause the function to return rather than continue. Thus, when previewing a theme with a hypen in the directory, all that is rendered is a white page.
The attached diff corrects this issue when scrubbing both the template and the stylesheet.
Attachments (2)
Change History (12)
#7
@
16 years ago
- Resolution fixed deleted
- Severity changed from normal to trivial
- Status changed from closed to reopened
This is probably overly punctilious, but the backslash is unnecessary and its intended purpose might seem unclear to people in the future. Patch attached.
#9
follow-up:
↓ 10
@
16 years ago
Just to play devil's advocate here, I'm not sure how putting the hyphen at the end again is less confusing. It simply adds the potential of reintroducing this bug if someone adds yet another character at the end of the character class.
#10
in reply to:
↑ 9
@
16 years ago
Replying to chrisbliss18:
Just to play devil's advocate here, I'm not sure how putting the hyphen at the end again is less confusing. It simply adds the potential of reintroducing this bug if someone adds yet another character at the end of the character class.
A mere backslash won't prevent all the potential damage to a regex done by someone who modifies it without understanding.
Moving the hyphen to the beginning or the end of the character class makes its purpose unambiguous to a knowledgeable person, and it eliminates an excess character.
And now I must return to trimming my lawn with a nail clipper.
See: #8548 (reopened defect (bug)): Theme preview fails when theme in subdirectory
(Might be best to close as duplicate and add patch over there?)