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
Comments
From dev.nnnn@gmail.com on August 20, 2012 07:21:52 One point I forgot to mention. |
From r.wetzlmayr on August 20, 2012 08:35:09 Status: Assigned |
From r.wetzlmayr on August 22, 2012 03:22:49 Punting this to 4.6. See issue 245 for details. Labels: Component-Core |
From r.wetzlmayr on August 22, 2012 03:23:31 Labels: -Milestone-4.5 Milestone-4.6 |
From r.wetzlmayr on December 25, 2013 01:51:20 Status: Confirmed |
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. |
fix issue #250 and show correct error message. Thanks Ruud
Closed by 4e5df26 |
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
The text was updated successfully, but these errors were encountered: