Webpath automatic conversion


(autjoe) #1

Hi, when a page is created that has "&" in the title the URL automatically converts it to "And". Is it possible to change this automatic conversion so that there are no upper case letters in that conversion?


(Bart Banda) #2

Hey, unfortunately not. You might be able to set up a trigger to do that, but haven't tried that myself.

 

I've created an idea for it in our roadmap system so hopefully we can have a feature for it built soon. 

 

https://squizmap.squiz.net/matrix/9248


(autjoe) #3

Thank you Bart for the advice.


(Chiranjivi Upreti) #4

Hi, when a page is created that has "&" in the title the URL automatically converts it to "And". Is it possible to change this automatic conversion so that there are no upper case letters in that conversion?

 

Not sure if I am missing anything but I tested in both admin and Edit+ interface and could not replicate the issue. Creating an asset name with "&" char will have this char converted to "and" in the webpath. For example: "black & white" will be converted into "black-and-white".

 

Can you give me more details on how to replicate this?


(Marcus Fong) #5

I can replicate it in a test system’s admin interface, Chiran - it looks to me like a combo of lines 434-439 in core/include/general_occasional.inc:

// no ampersands in web paths

$path = str_replace(’&’, SQ_CONF_WEB_PATH_SEPARATOR.translate(‘and’).SQ_CONF_WEB_PATH_SEPARATOR, $path);

$path = preg_replace(’|&[^;]+;|’, ‘’, $path);

$path = preg_replace(’|&#[0-9]+;|’, ‘’, $path);

$path = str_replace(’&’, SQ_CONF_WEB_PATH_SEPARATOR.translate(‘and’).SQ_CONF_WEB_PATH_SEPARATOR, $path);


and line 1594 in core/locale/en/lang_strings.xml:


<string source=“and”>And</string>