View Single Post
  #3 (permalink)  
Old 07-25-2007, 02:01 PM
liotier's Avatar
liotier liotier is offline
Casual Pligger
 
Join Date: Jul 2007
Location: Paris La Défense, France
Posts: 71
Thanks: 7
Thanked 11 Times in 8 Posts
Quote:
Originally Posted by liotier View Post
Since the database record itself is mangled, I guessed after reading a few threads that the answer may have something to do with libs/utils.php. I found that "é" and "ç" were both missing from the list of "$output = str_replace" character replacements around line 260 of libs/utils.php. Can that be the cause of my problem ?
Reflecting on that solution I thought that it would not work : the function I am talking about is named makeUrlFriendly() whereas my problem is sanitizing the title, not the URL.

But then more grepping led me to discover that this function is used in templates/yget/submit_step_3.tpl at line 58 to sanitize the title so that it can be used in the story's URL :

PHP Code:
$linkres->title_url makeUrlFriendly($linkres->title); 
So I modified libs/utils.php so that makeUrlFriendly() supports my problematic accents :

PHP Code:
276a277,281
>    $output str_replace("é""e"$output);
>    
$output str_replace("è""e"$output);
>    
$output str_replace("ç""c"$output);
>    
$output str_replace("ù""u"$output);
>    
$output str_replace("à""a"$output); 
A few tests later I confirmed that I have solved my problem.

Now, can anyone add that in the dev tree ?

Last edited by liotier; 07-25-2007 at 02:02 PM.. Reason: Typo
Reply With Quote
The Following User Says Thank You to liotier For This Useful Post: