[Webkit-unassigned] [Bug 193155] Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 4 13:57:16 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=193155

--- Comment #4 from Chris Dumez <cdumez at apple.com> ---
(In reply to Chris Dumez from comment #3)
> diff --git a/Source/WebCore/html/URLUtils.h b/Source/WebCore/html/URLUtils.h
> index 3a8d5413f93..a957910aacd 100644
> --- a/Source/WebCore/html/URLUtils.h
> +++ b/Source/WebCore/html/URLUtils.h
> @@ -90,6 +90,8 @@ String URLUtils<T>::origin() const
>  template <typename T>
>  String URLUtils<T>::protocol() const
>  {
> +    if (WTF::protocolIsJavaScript(url))
> +        return "javascript:"_s;
>      return makeString(href().protocol(), ':');
>  }
> 
> ?

Meant:
--- a/Source/WebCore/html/URLUtils.h
+++ b/Source/WebCore/html/URLUtils.h
@@ -90,6 +90,8 @@ String URLUtils<T>::origin() const
 template <typename T>
 String URLUtils<T>::protocol() const
 {
+    if (WTF::protocolIsJavaScript(href()))
+        return "javascript:"_s;
     return makeString(href().protocol(), ':');
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190104/830785b0/attachment.html>


More information about the webkit-unassigned mailing list