{"action":"created","issue":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/488","repository_url":"https://api.github.com/repos/processwire/processwire-issues","labels_url":"https://api.github.com/repos/processwire/processwire-issues/issues/488/labels{/name}","comments_url":"https://api.github.com/repos/processwire/processwire-issues/issues/488/comments","events_url":"https://api.github.com/repos/processwire/processwire-issues/issues/488/events","html_url":"https://github.com/processwire/processwire-issues/issues/488","id":295055244,"number":488,"title":"Different url-segment handling depending on the setting of $config->pageNameCharset","user":{"login":"weberhofer","id":793251,"avatar_url":"https://avatars0.githubusercontent.com/u/793251?v=4","gravatar_id":"","url":"https://api.github.com/users/weberhofer","html_url":"https://github.com/weberhofer","followers_url":"https://api.github.com/users/weberhofer/followers","following_url":"https://api.github.com/users/weberhofer/following{/other_user}","gists_url":"https://api.github.com/users/weberhofer/gists{/gist_id}","starred_url":"https://api.github.com/users/weberhofer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weberhofer/subscriptions","organizations_url":"https://api.github.com/users/weberhofer/orgs","repos_url":"https://api.github.com/users/weberhofer/repos","events_url":"https://api.github.com/users/weberhofer/events{/privacy}","received_events_url":"https://api.github.com/users/weberhofer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T09:00:25Z","updated_at":"2018-02-07T10:01:43Z","closed_at":null,"author_association":"NONE","body":"Processwire Version: 3.0.89\r\n\r\n### Short description of the issue\r\n\r\n issue arises resulting of a problem in WireInput->setUrlSegment. My setup allows a URL Segment \"logIn\" (uppercase \"i\") which works nicely as long as I don't set pageNameCharset to UTF8.\r\n\r\nSwitching to UTF8 makes processwire send me an redirect from .../logIn to .../login which is not defined as an allowed segment.\r\n\r\n### Optional: Suggestion for a possible fix\r\n\r\nProcesswire Version: 3.0.89\r\n\r\nA issue arises resulting of a problem in WireInput->setUrlSegment. My setup allows a URL Segment \"logIn\" (uppercase \"i\") which works nicely as long as I don't set pageNameCharset.\r\n\r\nWireInput (around line 295) uses **Sanitizer->name()** to clean up the segment's name. As soon as I set $config->pageNameCharset='UTF8', Sanitizer->pageNameUTF8() is called.\r\nAs there are no \"special\" characters in the given segment, it hands over to **Sanitizer->pageName()** on line 473.\r\nSo different methods are used for cleaning up the string: In the regular case Sanitizer->name(), in the UTF8 case it's Sanitizer->pageName(). \r\n\r\nThe results of the two functions differ: In my case the \"logIn\" is translated to \"login\" and the client is redirected to this page. As the \"login\" segment doesn't exist the redirect results into an error page.\r\n\r\nI see the following possibilities:\r\n- Let Sanitizer->pageNameUTF8() call $this->name() on line 473. Let Sanitizer->name() respect the $config->pageNameCharset correctly.\r\n- remove the conversion to lower case at the end of Sanitizer->pageName()\r\n- add another parameter to sanitizer->pageName() which allows the invoking method to decide if a lowercase conversion should be done.\r\n- Create a single point for doing the filtering of (UTF8) characters and access this from different methods.\r\n\r\nI don't understand why there are different functions name() and pageName() - shouldn't they do the same?\r\nI have also seen some \"punycode\" handling in there: punycode is only relevant for hostnames - so why is there a punycode handling in the pageName() sanitizer?\r\n\r\nI could submit patches but I'd like to know which way do go before I implement something, so please get in contact with me."},"comment":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/comments/363717872","html_url":"https://github.com/processwire/processwire-issues/issues/488#issuecomment-363717872","issue_url":"https://api.github.com/repos/processwire/processwire-issues/issues/488","id":363717872,"user":{"login":"Lazerproof","id":5707348,"avatar_url":"https://avatars3.githubusercontent.com/u/5707348?v=4","gravatar_id":"","url":"https://api.github.com/users/Lazerproof","html_url":"https://github.com/Lazerproof","followers_url":"https://api.github.com/users/Lazerproof/followers","following_url":"https://api.github.com/users/Lazerproof/following{/other_user}","gists_url":"https://api.github.com/users/Lazerproof/gists{/gist_id}","starred_url":"https://api.github.com/users/Lazerproof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lazerproof/subscriptions","organizations_url":"https://api.github.com/users/Lazerproof/orgs","repos_url":"https://api.github.com/users/Lazerproof/repos","events_url":"https://api.github.com/users/Lazerproof/events{/privacy}","received_events_url":"https://api.github.com/users/Lazerproof/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T10:01:43Z","updated_at":"2018-02-07T10:01:43Z","author_association":"NONE","body":"I'm not sure, but it looks like URL Segments is intended to use be used in lowercase as they are sanitized by default as page names and page names by default support lowercase ASCII letters and not uppercase. "}}
{"actor":{"display_login":"Lazerproof"}}