[webkit-changes] [WebKit/WebKit] a15778: _WKWebExtensionMatchPattern matchPatternWithString...

Timothy Hatcher noreply at github.com
Tue Oct 10 19:08:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a15778d2d11bef82741c4291808af1f0fde0f909
      https://github.com/WebKit/WebKit/commit/a15778d2d11bef82741c4291808af1f0fde0f909
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M Source/WebCore/page/UserContentURLPattern.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionMatchPattern.mm

  Log Message:
  -----------
  _WKWebExtensionMatchPattern matchPatternWithString should fail if passed a string with a port.
https://webkit.org/b/262976
rdar://problem/116760000

Reviewed by Brian Weinstein.

Return InvalidHost error if a pattern is passed that has a port. Ports are not valid in Chrome and
Firefox, and the UserContentURLPattern class didn't check them either. It was happily putting the
port in the host string and failing to match later.

Also return InvalidHost if the host has "@", which is used for user login info.

* Source/WebCore/page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::UserContentURLPattern):
(WebCore::UserContentURLPattern::parse):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionMatchPattern.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/269182@main




More information about the webkit-changes mailing list