Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Dec 2014 at 13:40 UTC
Updated:
25 Jul 2016 at 21:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
maciej.zgadzaj commentedProposed patch fixing the issue.
Comment #2
mpv commented@maciej.zgadzaj thanks, I like your solution. I'm attaching the patch for drupal 7.x in case anyone finds it useful.
Comment #3
wonder95 commentedI've been using this for 5 months now, and it works perfectly. I'm still re-applying it after every core update for D7, so it would be nice if it could be committed.
Comment #5
Andre-B#2 works for me
Comment #6
dawehnerWe killed that in the meantime.
Comment #7
Andre-Bhow and when was this solved for d7?
Comment #8
longwaveReopening for 7.x, someone should upload #2 as a .patch file for it to be tested.
Comment #9
sagar ramgade commentedHere's the patch from #2.
Comment #10
sagar ramgade commentedComment #11
drikc commentedSuccessfully skip item value encoding by using the encoded property!
Comment #12
David_Rothstein commentedThe patch looks good, but I think the new option definitely needs to be mentioned in the function documentation. (Especially since it has security implications - we need to be really clear in the documentation when it should/shouldn't be used.)
Comment #13
mpv commentedHere's the patch with updated funcion documentation.
Comment #14
mpv commentedComment #15
wonder95 commentedThis has been out there for a year and a half, and it now has function documentation as well as a test. Can we please get this committed so that I don't have to manually re-add this patch after every update?
Comment #16
fabianx commentedWe usually don't reference issues in code in D7 - except for @todo's.
Lets also add something like:
"Only use this option if you have already escaped the data as not doing so has security implications."
Comment #17
davic commentedRemoved the issue reference as it's not a common use in drupal 7 (see #16) and added the comment suggestion by Fabianx.
Comment #18
fabianx commentedRTBC, Stefan will need to commit this.
Comment #19
stefan.r commentedDavid, are you happy with docs here?
Comment #20
David_Rothstein commentedMostly looks good, but the new sentence should be part of the previous paragraph - otherwise it's not clear what it refers to.
Also, if you CDATA-escape untrusted input, that doesn't make it safe (at least not when done naively, and I'm not aware of any function in Drupal or PHP that helps you do CDATA-escaping safely).
So thinking about this a bit more... maybe we should be safe and always just recommend entity-encoding in the case where you're working with untrusted user input? (My understanding is that they are basically interchangeable anyway.)
Like the attached, in other words.
Comment #21
David_Rothstein commentedSaving issue credits - I think there is a bug on drupal.org that sometimes makes them get out of whack.
Comment #22
stefan.r commentedI think the current wording makes sense...
Comment #23
stefan.r commentedComment #25
stefan.r commentedCommitted and pushed to 7.x, thanks!
Comment #26
stefan.r commentedComment #27
nevergoneWrong changelog.
Comment #29
stefan.r commentedThanks @nevergone
Comment #30
sagar ramgade commented@stefan just noticed a small typo in the above patch, there are two "a":
Comment #31
sagar ramgade commentedComment #34
sagar ramgade commentedComment #36
wonder95 commentedThanks for getting this done and committed, everyone. This will be a huge headache saver for me.