Skip to content

Speculation rules: URL patterns need escaping to work correctly when special characters are present #950

Closed

Description

@jeremyroman

Bug Description

If WordPress is deployed with an unusual path prefix (notably WordPress Playground uses something like /scope:0.123456/), this isn't properly escaped and the resulting patterns fail to parse.

Steps to reproduce

  1. Go to https://playground.wordpress.net/?plugin=speculation-rules.
  2. Open one of the pages at the top level.
  3. Observe that there are errors in the developer console resulting pages.

Screenshots

n/a

Additional Context

  • PHP Version: 7.4
  • OS: Linux
  • Browser: Chrome (121 beta)
  • Plugin Version: trunk
  • Device: Linux desktop

Activity

  1. added
    [Type] Bug
    on Jan 20, 2024
  2. jeremyroman commented on Jan 20, 2024

    @jeremyroman
    ContributorAuthor

    This probably needs the following labels, though I don't think I have permission to apply them:

    • [Focus] JS & CSS
    • [Module] Speculation Rules
    • Performance Lab Plugin
  3. added
    [Plugin] Speculative Loading
    on Jan 20, 2024
  4. westonruter commented on Feb 5, 2024

    @westonruter
    Member

    Done in #951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Plugin] Performance Lab[Plugin] Speculative Loading[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions