Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
dblog.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2015 at 21:16 UTC
Updated:
5 Dec 2015 at 20:54 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
joelpittetThis solves the problem, but I think formatMessage() would be a better place to solve it like you mentioned.
This works as well.
Comment #2
subhojit777There is already an issue for this #2345779: Fix double-escaping due to Twig autoescape in dblog event "operations", see comment. We should close this one.
Comment #3
cburschkaSorry, the other issue did not fix this. That patch targeted the "operations" links; the message itself is still escaped.
Screenshot from an install based on the latest source (commit c83565f6).
Edit: Based on looking at some of the rejected patches, it seems that some of them did try to fix the message too, but after some iterations the one that ultimately got committed only got the link.
Comment #4
cburschkaLast patch still applies with small offset, and still fixes the problem.
Comment #5
subhojit777Patch looks good. I would have RTBC'd it, but not sure whether it needs tests.
Comment #6
ruscoe commentedHad to make a small change to the patch from #1 to get this working for me.
I wrapped the formatted message in a call to
SafeMarkup::setto bringDbLogController::formatMessagein line with howDbLogController::overviewdisplays the log message.Comment #7
dawehnerBefore we change that we should be 100% ensure that we have a test to ensure that we escape once here.
Comment #8
pwolanin commentedWe should not be adding any uses of SafeMarkup::set()
Instead, we possibly want to use SafeMarkup::checkAdminXss($string), or the suggested inline code inside that method.
Comment #9
cburschkaWhat would be the correct approach here?
Edit: ah
Comment #10
subhojit777Comment #11
subhojit777Comment #12
subhojit777Not using
SafeMarkup::checkAdminXss($string)and usingSafeMarkup::xssFilter($string)because the former function will be deprecated soon.Comment #13
subhojit777Comment #14
subhojit777oops, looks like something's wrong. This patch
exception_log_messages-2409881-12-only-test.patchshould have failed.Comment #15
subhojit777Comment #16
subhojit777looks like the test works with
<script>tag, and fails with<em>tag.Comment #18
subhojit777Comment #20
dawehnerSo yeah the patch no longer works as expected ...
Comment #21
pwolanin commentedThis seems to be fixed in HEAD - I cannot reproduce it and the text is not double escaped.