?
avatar alexvanniel
alexvanniel
26 Sep 2014

Steps to reproduce the issue

Easy reproduction of this behaviour can be achieved by opening the Weblinks component in de Administrator, create a new Weblink (or edit an existing Weblink) and add #sometag to the end of the url in the URL field. For instance: http://www.google.nl/index.php#anchor

Expected result

The expected result would be a Weblink with the # part still in tact. Like with the google example the url would remain: http://www.google.nl/index.php#anchor

Actual result

Instead of the expected result, the url get's "sanitized" and looses the # element. In the example of the google url it results in http://www.google.nl/index.php where everything after the # is removed.

System information (as much as possible)

  • Joomla 3.3.4 Stable [ Ember ] 23-September-2014 14:00 GMT
    Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
    Ubuntu 14.04
    PHP 5.5.9
    Apache 2.4.7

  • Joomla 3.3.4 Stable [ Ember ] 23-September-2014 14:00 GMT
    Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
    Windows Server 2008
    PHP 5.3.15
    IIS7

Additional comments

To be clear, this is NOT an issue with the com_weblinks component since it is also something that happens with components we build ourselves from scratch.

It looks like the fragment part is not reassembled when JStringPunycode::urlToUTF8() or JStringPunycode::urlToPunycode() is executed. In both methods the scheme, port, path and query are put back in the $newuri variable that is returned but the fragment part is left out.

A possible fix would be to add the following three lines to the end of both methods:

if (!empty($parsed['fragment']))
{
$newuri .= '#' . $parsed['fragment'];
}

avatar alexvanniel alexvanniel - open - 26 Sep 2014
avatar alexvanniel alexvanniel - change - 26 Sep 2014
Category Libraries
avatar alexvanniel alexvanniel - change - 26 Sep 2014
The description was changed
Title
JStringPunycode methods or JString::parse_url strip # (hashtag) element from URL
JStringPunycode methods strip # (fragment) element from URL
avatar Kubik-Rubik Kubik-Rubik - change - 26 Sep 2014
Status New Confirmed
avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

I can reproduce this issue, changed status to "Confirmed"!

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

Can you provide a PR? Or should I do it?

avatar alexvanniel
alexvanniel - comment - 26 Sep 2014

Excuse my ignorance but what is a PR exactly??
Op 26 sep. 2014 17:28 schreef "Viktor Vogel" notifications@github.com:

Can you provide a PR? Or should I do it?


Reply to this email directly or view it on GitHub
#4357 (comment).

avatar alexvanniel
alexvanniel - comment - 26 Sep 2014

I figured out what a PR is (kind of) but I fear I am not able to provide/create that. Could you maybe try and do that or maybe explain how to do this?

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar mbabker
mbabker - comment - 26 Sep 2014

This should help you out if you're willing to give it a try -
http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

On Fri, Sep 26, 2014 at 7:04 PM, alexvanniel notifications@github.com
wrote:

I figured out what a PR is (kind of) but I fear I am not able to
provide/create that. Could you maybe try and do that or maybe explain how
to do this?

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
http://issues.joomla.org/http://issues.joomla.org/
http://issues.joomla.org/.


Reply to this email directly or view it on GitHub
#4357 (comment).

avatar alexvanniel
alexvanniel - comment - 26 Sep 2014

Thanks mbaker, I hope I did it correctly. The PR I made can be found here: #4362

Please, if you have ANY comments on my PR, let me know. This is my first (and hopefully not the last) request so any comments are welcome and will be useful in the future.

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar jissues-bot
jissues-bot - comment - 27 Sep 2014

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org

avatar jissues-bot jissues-bot - close - 27 Sep 2014
avatar zero-24 zero-24 - close - 27 Sep 2014
avatar zero-24 zero-24 - change - 27 Sep 2014
Category Libraries
avatar zero-24 zero-24 - change - 27 Sep 2014
Status Confirmed Closed
avatar jissues-bot jissues-bot - change - 27 Sep 2014
Closed_Date 0000-00-00 00:00:00 2014-09-27 12:58:43
avatar zero-24
zero-24 - comment - 27 Sep 2014

closing as we have a pull here #4362

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment