YOURLS / YOURLS/YOURLS

Space is double-escaped when submitting custom shorturl keyword

Open
#3,698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
12.2k
Forks
2.1k
Avg merge
6h 15m
Merged PRs (30d)
7

Description

Code of Conduct
Submission validity
  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.
Self troubleshooting
Version

1.9.2

Description

When using a simple custom plugin such as shown in #3694 to allow (%20) in shorturl keywords, it is still not possible to create a custom keyword containing via the admin panel.

As submitted to the admin-ajax.php endpoint, the custom keyword (e.g. some space) appears to be double-escaped as some%2520space in the parameters sent. This leads the backend to create a shorturl with the incorrect keyword some20space.

Expectation

The frontend should only escape the keyword parameter containing a space once (some%20space), and the backend should then create the keyword some space (assuming that has been added to the shorturl charset by a plugin).

Reproduction steps

No response

Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing custom keyword submission through the admin panel to the admin-ajax.php endpoint, using the double-escaped value described in the issue. Check where the keyword is escaped on the frontend and decoded by the backend. Done means a keyword such as some space is sent once as some%20space and is created as some space when a plugin permits spaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
full-stack
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.