Closed (fixed)
Project:
Simple Background image formatter
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2015 at 11:20 UTC
Updated:
30 Nov 2015 at 22:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelstein commentedComment #3
alesr commentedRemoving check_plain() is not a solution.
Comment #4
joelstein commentedWell, you can't send a full element array to check_plain(), hence the warning and the issue. So we have to remove it.
However, I suspect you just want to make sure that the class is properly escaped to prevent XSS. You're already doing that, but here's a patch which consolidates efforts to use filter_xss() before sending the data to the various theme functions.
Comment #5
garethhallnz commentedI have review the code and for the most part I concur with #4.
a) I can see to reason why we need #element_validate so lets remove it.
b) Yes the main concern was XSS but removing str_ireplace() creates another issue. I think a simpler solution is to simply do a strip_tags.
Joel do you mind testing my patch?
Comment #6
joelstein commentedWhat issue is created by removing str_ireplace()?
Comment #7
garethhallnz commentedWhen a css selector looked liked this .myclass > div then the > got encoded to an html entity. Initially when I wrote the module I was under the impression filter_xss would not encode the > but just escape it .... that didn't seem to be the case in my testing; perhaps it has something todo with the field api and or ui.
As I mentioned in #5 (b) I think a simpler solution is the use php's strip tags function, this makes sense to me and there is no good reason to allow code / tags or markup in a css selector.
Comment #8
joelstein commentedstrip_tags sounds good to me.
Comment #10
garethhallnz commentedComment #11
joelstein commentedThanks!
Comment #12
garethhallnz commented