-
☆ A M B ☆
- 24,524 Posts
Has anybody successfully used a different language for the document’s alias? URLencoded?
-
☆ A M B ☆
- 24,524 Posts
Ok, I made an ugly hack in the save_content.processor.php file; I commented out the line
//$alias = preg_replace('/[^\.%A-Za-z0-9 _-]/', '', $alias);
as well as changed all the instances of mysql_escape_string() to mysql_real_escape_string(). It’s working fine on my local MAMP server as well as my remote Linux virtual private server. I don’t know what the full ramifications of this would be; I suppose it would mean that a malicious manager user could put it some kind of evil alias? But then if one has a malicious manager, I would think that one would have bigger problems.
-
☆ A M B ☆
- 24,524 Posts
Read it; it’s a few years old. This works for Hebrew in FF and Safari; time will tell if it works otherwise. The site is in utf-8, which should help.
Correct me if I am wrong. Modx is UTF-8 by default correct? so if your database is utf-8 and the template uses utf-8 charaset, whatever language you type in in the alias, it should display properly in Safari, FF and Opera.
Last year I did a Chinese site in Textpattern, the document names show up in Chinese properly. I checked IE but it was not, however, my friend, the site owner, who is using Chinese version XP, told me he can see the document name in Chinese from his IE.
-
☆ A M B ☆
- 24,524 Posts
Quote from: chinesedream at Jul 02, 2008, 06:44 PM
Last year I did a Chinese site in Textpattern, the document names show up in Chinese properly. I checked IE but it was not, however, my friend, the site owner, who is using Chinese version XP, told me he can see the document name in Chinese from his IE.
I just saw a reference to a setting in IE that would allow it to do that; I thought I bookmarked it but did not.
I’m not worried about evil things being put in the alias; if the client wants it this way that’s his problem. And it is working just fine, so I thought the knowledge of how to get this working with MODx might be useful to others.
As far as being utf-8, that depends entirely on the database configuration. You can set the MODx charset to whatever you want, and it won’t do much good unless the database is supporting that charset as well.
http://www.ietf.org/rfc/rfc3987.txt
http://support.microsoft.com/?kbid=842848
http://support.microsoft.com/kb/925261
Just browsing this thread - I have experimented with Hebrew document aliases and they worked fine in FF. I guess I am missing something here, but, what is the hack for exactly?
-
☆ A M B ☆
- 24,524 Posts
there is a line to convert all non-ASCII alphanumeric characters and - and _ to a null in the save_content processor. It wouldn’t allow the saving of a Hebrew text alias. I just commented out that line.