Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
batch system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2015 at 18:02 UTC
Updated:
4 Sep 2015 at 19:24 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
rainbowarrayMarking this as major which is maybe debatable, but this is one of the first things somebody sees when installing Drupal. It looks awful.
Comment #3
stefan.r commentedWe probably shouldn't be autoescaping the HTML in the init message (the render array is in _batch_progress_page()):
Comment #4
stefan.r commentedI can't reproduce this, the init message is unescaped for me on HEAD
Comment #5
rainbowarrayIt's strange. It flashes unescaped but then switches to escaped during the install process. That makes me wonder if there's some sort of JS replacement going on.
Comment #6
stefan.r commentedI did manage to reproduce this in the end. There is actually some JS replacement in progress.js, where it does
$('div.progress__description', this.element).html(message);. So it really is just a flash.Here's an attempt at a patch...
Comment #7
rainbowarrayI did not see the flash of special characters when I just tried an install with this patch. Nice work.
Comment #8
lauriiiNice to see it becoming a render array. Just curious, why do we need the $message to be escaped with Xss::filter? Isn't that the default behaviour of '#markup'?
Comment #9
stefan.r commentedHmm you're right. #markup does admin XSS escaping which may be enough here assuming it's only admin users who ever see a progress bar. So maybe this could be a 1 line fix.
Comment #10
stefan.r commentedComment #11
stefan.r commentedComment #12
joelpittetThis could use some tests if possible but I think you can fairly assume that the message wouldn't need markup beyond what Xss admin filtering allows.
Comment #13
stefan.r commentedAdded a test
Comment #14
stefan.r commentedComment #15
stefan.r commentedComment #16
stefan.r commentedComment #17
stefan.r commentedreverting a change from that last patch
Comment #18
stefan.r commentedAnd if you disable javascript it's not just on the initial step, but everywhere:
Comment #19
stefan.r commentedComment #20
stefan.r commentedComment #21
stefan.r commentedComment #22
idebr commentedI reported this earlier in #2443005: Html displayed as text in installer initial batch operations message
Comment #23
Aki Tendo commentedLooks good to me.
Comment #24
stefan.r commentedComment #25
lauriiiRTBC++
Comment #26
catchThe error handling also uses a
<br />tag in two different places - do you know whether this is also double escaped?Also wondering whether there's something simple we can do to just ditch the hardcoded
<br />altogether.Comment #27
stefan.r commentedWe should ditch most
<br />tags but for this one I'm not sure how or what it's purpose is. Some CSS trickery on the.progress__descriptionmay be possible, but IMO it's out of scope here as it's much less of an issue than the HTML escaping, where all labels are affected (not just the <br />thing), and many of them have markup which also gets escaped (ie. #18).As to the
<br />from the batch error handler, I tested and it's not double escaped:The linebreak there is easier to get rid of, we can just wrap each error message in a block-level element instead.
The other bit is JS so unrelated.
Comment #28
stefan.r commentedClarifying in the IS that this does not just affect the installer.
Comment #29
catchMakes sense. Opened #2555567: Remove hard-coded <br /> from batch API in case anyone wants to look at the break tags.
Committed/pushed to 8.0.x, thanks!