Closed (fixed)
Project:
Drupal core
Version:
8.1.x-dev
Component:
theme system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Sep 2015 at 14:29 UTC
Updated:
31 May 2016 at 10:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mgiffordHow would this be tested, just with Core?
Comment #3
David_Rothstein commented#2646328: CSRF in update module manual check links might show an example of this.
Maybe it's by design that if you don't generate the link as a render array then it doesn't get the cacheability data correct? But that seems somewhat unsatisfying since there are multiple ways to generate URLs and links and it would be nice for them to work equally well.
Comment #5
wim leersConfirmed while I worked on #2646328-31: CSRF in update module manual check links.
Quoting my analysis from there:
Comment #6
wim leersComment #7
wim leersHere's the patch from #2646328-31: CSRF in update module manual check links.
Comment #8
wim leersCleanup.
Comment #9
dawehnerCan't we avoid one level of nesting here actually? Basically keep the exact same code, beside the first if
Comment #10
alexpottRe #9 we could do an early return... and then lose the last if.
Comment #11
wim leersAddressed #9.
Addressed Alex' feedback from IRC:
I will write tests later today, unless somebody beats me to it.
Comment #12
wim leersNow with updated issue summary.
Comment #13
alexpottUnfortunately we have to fix this in more places :(
Comment #14
alexpottBeginning of some tests... we need more coverage for attachments and Renderable interface
Comment #15
dawehnerWorking on some more test coverage.
Comment #16
dawehnerHere is some simplification of the code + more test coverage aka. also take care into account libraries.
Comment #18
dawehnerThere we go
Comment #19
joelpittetThis has tests. I've ran the tests manually and read through the code and it seems to be doing what it needs to achieve this fix.
TwigExtensionTestwill fail before this fix and passess afterwards.ThemeRenderAndAutoescapeTestneeds the datastructure that is provided to theRenderContext()via bubbling.Comment #21
berdirCould be a random fail:
Didn't fail like that before.
Comment #22
berdirRequested a re-test.
Comment #23
catchCommitted/pushed to both branches, thanks!
Comment #25
vorapoap commentedI confirm that this patch also fix CSRF Token problem in this Drupal StackExchange Issue