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

shortened IDN URLs unable to open - stored wrong (with %) in database (Firefox) #1810

Open
Wolfus3 opened this Issue Nov 14, 2014 · 8 comments

Comments

Projects
None yet
8 participants
@Wolfus3

Wolfus3 commented Nov 14, 2014

Reproducible Bug Summary

  1. Shorten any IDN URL, like www.tübingen.de
  2. output is: "http://t%c3%bcbingen.de added to database"
  3. open short link with Firefox (!) e.g.: http://siwik.de/go/s8z5
  4. Site-Loading error occurs (server not found), but URL is displayed correctly in address field. Must press ENTER, then website will be loaded.
  5. Bug only occurs (only?) with Firefox. Tested with Chrome and Opera - will work. Probably Chrome and Opera just opens everything what looks like a domain (well done,tho).

This is a bug because...
The IDN could be stored "correctly" in the database,
not http://t%c3%bcbingen.de
but http://tübingen.de (or to be "safe" the resolved pendant xn--blah-b--.de)

I installed the IDN plugin but this only seems to be useful if YOURLS is hosted ON AN IDN. But not for IDNs to be shortened.

Technical details

  • YOURLS version: 1.7
  • PHP version: 5.3.28
  • MySQL 5.5.35
  • Firefox 33.1
  • Opera 12.17
  • Chrome 38.0.2125.111 m

....and by the way some credits to OZH for this/his great work.

@heubergen

This comment has been minimized.

Show comment
Hide comment
@heubergen

heubergen Nov 14, 2014

Same problem here with safari 8.

heubergen commented Nov 14, 2014

Same problem here with safari 8.

@oyvind-lillegardsetre

This comment has been minimized.

Show comment
Hide comment
@oyvind-lillegardsetre

oyvind-lillegardsetre Mar 5, 2015

Got the same issue in IE 11

oyvind-lillegardsetre commented Mar 5, 2015

Got the same issue in IE 11

@Alinya

This comment has been minimized.

Show comment
Hide comment
@Alinya

Alinya Mar 12, 2015

Same/similiar issue with Firefox 36.0.1. The links work perfectly fine with Chrome though.
Also tested in Android Web browser, but the shortened link does not redirect to the long url properly either.
(Weird thing though is that it's a near-perfect copy of a working existing copy of a site running YOURLs, with only the relevant variables and values changed.)
Example: http://hswat.ml/ranks just leads to a blank page in Firefox 36.0.1 and Opera, but takes you to the actual page properly in Chrome. (Logged in to admin interface on chrome though)

Alinya commented Mar 12, 2015

Same/similiar issue with Firefox 36.0.1. The links work perfectly fine with Chrome though.
Also tested in Android Web browser, but the shortened link does not redirect to the long url properly either.
(Weird thing though is that it's a near-perfect copy of a working existing copy of a site running YOURLs, with only the relevant variables and values changed.)
Example: http://hswat.ml/ranks just leads to a blank page in Firefox 36.0.1 and Opera, but takes you to the actual page properly in Chrome. (Logged in to admin interface on chrome though)

@bmhm

This comment has been minimized.

Show comment
Hide comment
@bmhm

bmhm Mar 13, 2015

Hey, I got issues with all browser and got my site hosted at µ.domain.de. Yourls fails all the time.

You need to open ./includes/functions.php and edit the function yourls_get_request() after $root being set:

$root = idn_to_ascii($root);
$serverhost = idn_to_ascii($_SERVER['HOST']);

$request = str_replace($root . "/", '', $serverhost . $_SERVER['REQUEST_URI']);

I really don't like the coding style and the fact that I cannot use idn_to_utf8(). But this project seems abandoned. Shouldn't we fork it?

bmhm commented Mar 13, 2015

Hey, I got issues with all browser and got my site hosted at µ.domain.de. Yourls fails all the time.

You need to open ./includes/functions.php and edit the function yourls_get_request() after $root being set:

$root = idn_to_ascii($root);
$serverhost = idn_to_ascii($_SERVER['HOST']);

$request = str_replace($root . "/", '', $serverhost . $_SERVER['REQUEST_URI']);

I really don't like the coding style and the fact that I cannot use idn_to_utf8(). But this project seems abandoned. Shouldn't we fork it?

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Mar 25, 2015

Member

Sure, go ahead :)

Member

ozh commented Mar 25, 2015

Sure, go ahead :)

@ozh ozh added this to the 1.8 milestone Mar 25, 2015

@aendrew

This comment has been minimized.

Show comment
Hide comment
@aendrew

aendrew Apr 9, 2015

I have a similar issue; if I set the site URL as xn--6ca.ninja it works, and even http://æ.ninja/1 works, but if I set the site URL to æ.ninja, it redirects to front page every time. The only downside of using it the functional way is that it doesn't output the URL with the unicode character, so you have to manually replace the IDN value with the special character if you want the effect. Happy to PR this if it helps...

aendrew commented Apr 9, 2015

I have a similar issue; if I set the site URL as xn--6ca.ninja it works, and even http://æ.ninja/1 works, but if I set the site URL to æ.ninja, it redirects to front page every time. The only downside of using it the functional way is that it doesn't output the URL with the unicode character, so you have to manually replace the IDN value with the special character if you want the effect. Happy to PR this if it helps...

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Apr 9, 2015

Member

@aendrew aren't you mixing up 2 things: shortening an IDN domain, and using YOURLS on an IDN domain ?

Member

ozh commented Apr 9, 2015

@aendrew aren't you mixing up 2 things: shortening an IDN domain, and using YOURLS on an IDN domain ?

@aendrew

This comment has been minimized.

Show comment
Hide comment
@aendrew

aendrew Apr 9, 2015

@ozh Oh! Indeed I am. Should I open a new issue? Edit: Nevermind, found plugin.

aendrew commented Apr 9, 2015

@ozh Oh! Indeed I am. Should I open a new issue? Edit: Nevermind, found plugin.

@ozh ozh added the help wanted label Apr 17, 2017

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