<![CDATA[ Aliases not saved in 0.9.6 when MODx charset not set as UTF-8 - My Forums]]> https://forums.modx.com/thread/?thread=36381 <![CDATA[Re: Aliases not saved in 0.9.6 when MODx charset not set as UTF-8]]> https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205175
Need to develop new project without waiting for version update]]>
Aramaki Oct 17, 2007, 11:48 AM https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205175
<![CDATA[Re: Aliases not saved in 0.9.6 when MODx charset not set as UTF-8]]> https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205174 here

(It’s in french tongue)]]>
davidm Jul 18, 2007, 06:44 AM https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205174
<![CDATA[Re: Aliases not saved in 0.9.6 when MODx charset not set as UTF-8]]> https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205173 ]]> rethrash Jul 17, 2007, 10:09 AM https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205173 <![CDATA[Aliases not saved in 0.9.6 when MODx charset not set as UTF-8]]> https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205172

MODx 0.9.6 has been released in May 2007 and nobody seems to have noticed that there was a problem with documents aliases.

In "manager/processors/save_content.processor.php", in the function "stripAlias()" on line 859 :
$alias = strtr($alias, $replace_array);

The problem is that the array "$replace_array" is only declared if the configuration charset is set as UTF-8 :
if (strtoupper($modx->config['modx_charset']) == 'UTF-8'){

So, an error occured while saving the alias because the function "strtr()" don’t find any array as second parameter.

To make the thing work even if the configuration charset is not UTF-8, this should be placed within the "if" statement :
$alias = strtr($alias, $replace_array);


I hope this would be helpful (and quickly corrected).


Thank you,


Benjamin
]]>
zombiemx Jul 17, 2007, 09:01 AM https://forums.modx.com/thread/36381/aliases-not-saved-in-0-9-6-when-modx-charset-not-set-as-utf-8#dis-post-205172