Closed (cannot reproduce)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Mar 2017 at 10:36 UTC
Updated:
5 Apr 2024 at 11:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adhariwal commentedComment #3
cilefen commentedComment #4
goz commentedI don't know were you see this code
In 8.4.x, it's
http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Component/Utility...
which work as expected.
Testing with :
result :
something & something & elseEverything look fine.
Comment #5
adhariwal commented@GoZ: See these lines:

Here inside str_replace we are searching for the "&" and replacing it with
which works well if string does not contain any encoded html entities. Like you tested. But this is not the case to reproduce this bug. Use a string contains already encoded html entities. like the following string:


The str_replace output will look like this:
Not sure rest of the code takes care of this situation.
Comment #6
goz commentedOk, let's open this again to discuss.
I'm really not sure it's a bug.
Can you explain in which case you have to send encoded html to Xss::filterAdmin() ?
We need something to reproduce, not only testing Xss::filterAdmin() with encoded html from php-eval but a real Drupal case.
Comment #7
adhariwal commented@GoZ: https://www.drupal.org/node/2856598
- The above is the parent issue, When we rewrite the field output in a view and use a field token to render the output in this scenario the above issue will be reproduced.
This is the one case where i have seen it happening but there will be more cases apart from views.
Initially I thought it is something only related to views and submitted the patch in https://www.drupal.org/node/2856598 issue.
Thanks.
Comment #8
pradeep22saini commented@abhishek
Can you provide the use case in terms of Views or other features where this is occurring? It is still unclear in what context encoded entity is passed.
Comment #9
pradeep22saini commentedComment #10
pradeep22saini commented@adhariwal
Please ignore above comments. I am able to reproduce this issue. As suggested in views.
Comment #23
pameeela commentedThe related issue is now fixed, I wonder if this can be closed? #2856598: Views field rewrite replacement subtoken yields double encoded HTML entities
There are no steps to reproduce document and the instance in comments appears to be the same as the other issue that was fixed.
Comment #24
longwaveIndeed, can't reproduce this:
Xss::filter() does defuse all entities initially, but then it converts named entities such as
&back again:Closing as cannot reproduce.