StreamAlex Posted October 28, 2013 Share Posted October 28, 2013 I use Swedish as language and when I use the letters Ã¥ (å), ä (ä) and ö (ö) in the product and category names they get replaced with a hyphen (-) in the URLs. I want them to be replaced with the letters "a" and "o" instead. How do I fix this? I use latest version of CubeCart. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 28, 2013 Share Posted October 28, 2013 Hi Alex, This has been an issue for a while as the default PHP code to allow "a-z" doesn't include "special characters" like the ones you mention so there is no automated way we can sanitize this keeping such characters... If you open includes/functions.inc.php remove at around line 723: $path = preg_replace('/[^a-z0-9-_/]/', '-', $path); It will then stop replacing characters other than a-z 0-9 '-' and '/' with a hyphen and it will accept your paths. Quote Link to comment Share on other sites More sharing options...
StreamAlex Posted October 28, 2013 Author Share Posted October 28, 2013 Thank you for the information. I will try that. Otherwise I just continue changing the urls manually. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 28, 2013 Share Posted October 28, 2013 I did some work on that and my solution was to permit % as a legal character. I believe "special" characters are essentially disallowed as characters in a URL path. It will be real tricky as such characters may get translated into their hex code equivalent. Will it be the single byte upper-ascii or the 2,3-byte UTF-8? In the end of my experiments, my 'legal' URL is the result of rawurlencode($path) which converts the UTF-8 upper bytes to, for example, %C0%56. This gets databased safely, and mostly survives getting clicked on as a link. The goal is to have the database CC_seo_paths table have a match against what the querystring 'seo_path' comes in as. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.