Opened 3 years ago

Last modified 3 weeks ago

#19528 assigned Bug

CachedFilesMixin does not rewrite rules for css selector with path

Reported by: mike@… Owned by: jnovinger
Component: contrib.staticfiles Version: 1.4
Severity: Normal Keywords: CachedFilesMixin staticfiles djbday
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Using CachedFilesMixin we'll have paths like this
<img alt="True" src="/media/static/admin/img/icon-yes.0596085e212f.gif">
after template rendering, but an unmodified selector:
img[src$="admin/img/icon-yes.gif"] in processed stylesheet.

This happens because CachedFilesMixin.patterns does not contain a rule like this """(img\[src[\^\$\*]{0,1}=\s*["']\s*(.*?)["'])""" to match against and actually can not deal with ^=|$=|*= operators. I am not sure how such paths can be properly processed, though.

Change History (3)

comment:1 Changed 3 years ago by akaariai

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Totally out of my expertise area, but seems valid.

comment:2 Changed 3 weeks ago by jnovinger

  • Owner changed from nobody to jnovinger
  • Status changed from new to assigned

comment:3 Changed 3 weeks ago by jnovinger

  • Keywords djbday added
Note: See TracTickets for help on using tickets.
Back to Top