Skip to content

URI inputs should sanitize anchor links from uris #1712

@jasonbahl

Description

@jasonbahl

Problem

When a page has a path such as my-page/#some-anchor-link, many clients will pass that as the id for a nodeByUri query.

While we could argue that the client should sanitize this and remove the anchor from the path prior to making a WPGraphQL request, I think it's reasonable to expect this will be sent to the server by many clients.

Proposal
Wherever nodes can be fetched by URI input, WPGraphQL should take into consideration that anchor links might included in the paths and resolve to the correct node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    close candidateNeeds confirmation before closingcomponent: queryRelating to GraphQL Queriesobject type: mediaRelating to the MediaItem Typeobject type: postRelating to the Post Object Typesobject type: termRelating to the Term Typesobject type: userRelating to the User Typestale?May need to be revalidated due to prolonged inactivitystatus: actionableReady for work to begintype: enhancementImprovements to existing functionality

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions