Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs that use %2B are converted to + #2530

RadGH opened this issue Jun 20, 2019 · 1 comment


None yet
2 participants
Copy link

commented Jun 20, 2019

Describe the bug
I am using ShareX to take screenshots, which upload to Amazon S3, and then a short link is created with YOURLs. This works fine most of the time.

When I take a screenshot of Notepad++, the filename that is generated looks like:

On Amazon S3, the URL encodes the plus signs as %2B:

When that URL is sent to YOURLs, the plus signs are converted back:

You can also test this quickly by adding your own short URL in the admin area. It doesn't have to be a real URL, for example: gets converted to

I created a small plugin to fix the problem, although this would break any URLs which DO use a literal plus sign:

yourls_add_filter( 'sanitize_url', 'rs_escape_plus_signs' );
function rs_escape_plus_signs( $in ) {
	return str_replace('+', '%2B', $in);

To Reproduce

  1. Create a shorturl for ""
  2. Notice it changes to ""
  3. For some hosts this is probably not an issue, but for amazon s3 it results in an error.

Expected behavior
Keep the original url with %2B

Actual behavior
The url changes to +

Example of the problem:

What it should be:

1.7.3 - I just updated to test, problem still exists

@RadGH RadGH added the bug label Jun 20, 2019


This comment has been minimized.

Copy link

commented Jun 24, 2019

When that URL is sent to YOURLs

The URL should be sent encoded. I mean %2B should be encoded, that value is %252B.
How do you send the URL to YOURLS?

@LeoColomb LeoColomb added encoding bug and removed bug labels Jun 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.