Commit 5082019e authored by webchick's avatar webchick

Issue #1884830 by pwolanin: Fixed Regression - replace md5 in Filter module calls with sha2 hashes.

parent ad5c0219
......@@ -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 -->";
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment