Skip to content
Snippets Groups Projects
Commit a633060b authored by catch's avatar catch
Browse files

Issue #3414900 by quietone, arunkumark, Meeni_Dhobale, smustgrave, poker10: Fix links that are 404

parent 63eddaef
No related branches found
No related tags found
No related merge requests found
......@@ -766,7 +766,7 @@ public function testUrlFilter() {
Absolute URL and query string with 2 different punctuation characters (http://www.example.com/q=abc).
Partial URL with brackets in the URL as well as surrounded brackets (www.foo.com/more_(than)_one_(parens)).
Absolute URL with square brackets in the URL as well as surrounded brackets [https://www.drupal.org/?class[]=1]
Absolute URL with quotes "https://www.drupal.org/sample"' => [
Absolute URL with quotes "https://www.example.org/sample"' => [
'period <a href="http://www.partial.com">www.partial.com</a>.' => TRUE,
'comma <a href="mailto:person@example.com">person@example.com</a>,' => TRUE,
'question <a href="http://www.absolute.com">http://www.absolute.com</a>?' => TRUE,
......@@ -776,7 +776,7 @@ public function testUrlFilter() {
'characters (<a href="http://www.example.com/q=abc">http://www.example.com/q=abc</a>).' => TRUE,
'brackets (<a href="http://www.foo.com/more_(than)_one_(parens)">www.foo.com/more_(than)_one_(parens)</a>).' => TRUE,
'brackets [<a href="https://www.drupal.org/?class[]=1">https://www.drupal.org/?class[]=1</a>]' => TRUE,
'quotes "<a href="https://www.drupal.org/sample">https://www.drupal.org/sample</a>"' => TRUE,
'quotes "<a href="https://www.example.org/sample">https://www.example.org/sample</a>"' => TRUE,
],
'(www.parenthesis.com/dir?a=1&b=2#a)' => [
'(<a href="http://www.parenthesis.com/dir?a=1&amp;b=2#a">www.parenthesis.com/dir?a=1&amp;b=2#a</a>)' => TRUE,
......
......@@ -243,7 +243,7 @@ public function testDrupalParseUrl() {
$this->assertEquals($result, UrlHelper::parse($url), 'Relative URL parsed correctly.');
// Test that drupal can recognize an absolute URL. Used to prevent attack vectors.
$url = 'https://www.drupal.org/foo/bar?foo=bar&bar=baz&baz#foo';
$url = 'https://www.example.org/foo/bar?foo=bar&bar=baz&baz#foo';
$this->assertTrue(UrlHelper::isExternal($url), 'Correctly identified an external URL.');
// Test that UrlHelper::parse() does not allow spoofing a URL to force a malicious redirect.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment