Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
5082019e
Commit
5082019e
authored
Feb 09, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1884830
by pwolanin: Fixed Regression - replace md5 in Filter module calls with sha2 hashes.
parent
ad5c0219
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
core/modules/filter/filter.module
core/modules/filter/filter.module
+1
-1
core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
...ter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
+2
-2
No files found.
core/modules/filter/filter.module
View file @
5082019e
...
...
@@ -1626,7 +1626,7 @@ function _filter_url_escape_comments($match, $escape = NULL) {
// Replace all HTML coments with a '<!-- [hash] -->' placeholder.
if
(
$mode
)
{
$content
=
$match
[
1
];
$hash
=
md5
(
$content
);
$hash
=
hash
(
'sha256'
,
$content
);
$comments
[
$hash
]
=
$content
;
return
"<!--
$hash
-->"
;
}
...
...
core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
View file @
5082019e
...
...
@@ -113,7 +113,7 @@ function testImageSource() {
$comment
[]
=
$image
.
':'
;
// Hash the image source in a custom test attribute, because it might
// contain characters that confuse XPath.
$comment
[]
=
'<img src="'
.
$image
.
'" testattribute="'
.
md5
(
$image
)
.
'" />'
;
$comment
[]
=
'<img src="'
.
$image
.
'" testattribute="'
.
hash
(
'sha256'
,
$image
)
.
'" />'
;
}
$edit
=
array
(
'comment_body[und][0][value]'
=>
implode
(
"
\n
"
,
$comment
),
...
...
@@ -121,7 +121,7 @@ function testImageSource() {
$this
->
drupalPost
(
'node/'
.
$this
->
node
->
nid
,
$edit
,
t
(
'Save'
));
foreach
(
$images
as
$image
=>
$converted
)
{
$found
=
FALSE
;
foreach
(
$this
->
xpath
(
'//img[@testattribute="'
.
md5
(
$image
)
.
'"]'
)
as
$element
)
{
foreach
(
$this
->
xpath
(
'//img[@testattribute="'
.
hash
(
'sha256'
,
$image
)
.
'"]'
)
as
$element
)
{
$found
=
TRUE
;
if
(
$converted
==
$red_x_image
)
{
$this
->
assertEqual
((
string
)
$element
[
'src'
],
$red_x_image
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment