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

Double urlencode? #250

Closed
ghost opened this issue Oct 4, 2014 · 7 comments
Closed

Double urlencode? #250

ghost opened this issue Oct 4, 2014 · 7 comments
Labels
Milestone

Comments

@ghost
Copy link

@ghost ghost commented Oct 4, 2014

From dev.nnnn@gmail.com on August 20, 2012 16:18:49

What steps will reproduce the problem? 1.Make a category using multi-byte (eg."報告")
2.Publish an article using the category.
3.View the article from top page, and the url of the category looks wierd. What is the expected output? What do you see instead? The encoded url seems to be encoded double, which makes the url very messy even using clean url. Using the category example "報告", the expected/insted output is as follows.
EXPECTED: http://example.com/textpattern/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA/%e5%a0%b1%e5%91%8a INSTEAD: http://example.com/textpattern/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA/%25e5%25a0%25b1%25e5%2591%258a/ Please use labels and text to provide additional information. Using the language Japanese, the clean-url shall be " http://example.com/textpattern/カテゴリ/報告 ", but the url becomes " http://example.com/textpattern/カテゴリ/%e5%a0%b1%e5%91%8a ".
Using urlencode, encoding "%e5%a0%b1%e5%91%8a" becomes "%25e5%25a0%25b1%25e5%2591%258a", which can be seen in the example above.
Since the link itself is working properly, it seems more like an extra encoding error when addind a new category.
The encoded string also can be observed by looking through the admin panel to edit the category while the category name will show the encoded string in the text-field (expected to be decoded. Maybe a different issue?). The category title seems to be decoded as expected (see attached screenshot).

Attachment: category_edit_Textpattern_CMS.png

Original issue: http://code.google.com/p/textpattern/issues/detail?id=246

@ghost ghost added imported core labels Oct 4, 2014
@ghost
Copy link
Author

@ghost ghost commented Oct 4, 2014

From dev.nnnn@gmail.com on August 20, 2012 07:21:52

One point I forgot to mention.
The proper urlencode for "報告" is "%e5%a0%b1%e5%91%8a" which is why I can assume and verify the expected url and the additional info.

@ghost
Copy link
Author

@ghost ghost commented Oct 4, 2014

From r.wetzlmayr on August 20, 2012 08:35:09

Status: Assigned
Owner: r.wetzlmayr
Labels: Milestone-4.5

@ghost
Copy link
Author

@ghost ghost commented Oct 4, 2014

From r.wetzlmayr on August 22, 2012 03:22:49

Punting this to 4.6. See issue 245 for details.

Labels: Component-Core

@ghost
Copy link
Author

@ghost ghost commented Oct 4, 2014

From r.wetzlmayr on August 22, 2012 03:23:31

Labels: -Milestone-4.5 Milestone-4.6

@ghost
Copy link
Author

@ghost ghost commented Oct 4, 2014

From r.wetzlmayr on December 25, 2013 01:51:20

Status: Confirmed
Owner: ---

@vanmelick
Copy link
Contributor

@vanmelick vanmelick commented Aug 14, 2015

The problem lies in the sanitizeForUrl function, which in this case uses rawurlencode on the input. I think this is incorrect, because we normally do escaping/encoding as late as possible. In fact urlescaping happens in pagelinkurl() (as it should) which is always used to create links based on the category name.

Also, as it is now, entering 報告 results first in an ugly category name %e5%a0%b1%e5%91%8a, but if you edit the category and save it again, that changes to e5a0b1e5918a. This should not occur.

Pull request sent.

Bloke added a commit that referenced this issue Aug 15, 2015
fix issue #250 and show correct error message. Thanks Ruud
@Bloke
Copy link
Member

@Bloke Bloke commented Aug 15, 2015

Closed by 4e5df26

@Bloke Bloke closed this Aug 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants