Loading

To subsitute specials characters

General Discussion around Collabtive

To subsitute specials characters

Postby Remiguel » 21.03.2015, 01:14

When we create a folder or upload a file, all specials characters are substituted with underscores.
Code in datei class shows that only germans characters are correctly treated

Code: Select all
 // Replace umlauts
        $folder = str_replace("√§", "ae" , $folder);
        $folder = str_replace("√∂", "oe" , $folder);
        $folder = str_replace("√º", "ue" , $folder);
        $folder = str_replace("√ü", "ss" , $folder);


I change the code for this one:

Code: Select all
// Replace unwanted characters
       
        $unwanted_array = array('≈†'=>'S', '≈°'=>'s', '≈Ω'=>'Z', '≈æ'=>'z', '√Ä'=>'A', '√Å'=>'A', '√Ç'=>'A', '√É'=>'A', '√Ñ'=>'A', '√Ö'=>'A', '√Ü'=>'A', '√á'=>'C', '√à'=>'E', '√â'=>'E',
                            '√ä'=>'E', '√ã'=>'E', '√å'=>'I', '√ç'=>'I', '√é'=>'I', '√è'=>'I', '√ë'=>'N', '√í'=>'O', '√ì'=>'O', '√î'=>'O', '√ï'=>'O', '√ñ'=>'O', '√ò'=>'O', '√ô'=>'U',
                            '√ö'=>'U', '√õ'=>'U', '√ú'=>'U', '√ù'=>'Y', '√û'=>'B', '√ü'=>'Ss', '√†'=>'a', '√°'=>'a', '√¢'=>'a', '√£'=>'a', '√§'=>'a', '√•'=>'a', '√¶'=>'a', '√ß'=>'c',
                            '√®'=>'e', '√©'=>'e', '√™'=>'e', '√´'=>'e', '√¨'=>'i', '√≠'=>'i', '√Æ'=>'i', '√Ø'=>'i', '√∞'=>'o', '√±'=>'n', '√≤'=>'o', '√≥'=>'o', '√¥'=>'o', '√µ'=>'o',
                            '√∂'=>'o', '√∏'=>'o', '√π'=>'u', '√∫'=>'u', '√ª'=>'u', '√Ω'=>'y', '√Ω'=>'y', '√æ'=>'b', '√ø'=>'y');
        $folder = strtr( $folder, $unwanted_array );


french and spanish names are now a bit clearer ;)
Remiguel
 
Posts: 96
Joined: 10.06.2014, 09:34
Location: Spain / France

Re: To subsitute specials characters

Postby Eva » 22.03.2015, 12:10

Could you submit this as a pull request on Github? The code does not display correctly in my browser.
Project Management the way you like it: Collaborative - Open Source - Free

facebook.com/Collabtive
twitter.com/Collabtive
xing.com/companies/collabtive
linkedin.com/company/collabtive
User avatar
Eva
 
Posts: 1471
Joined: 01.01.2008, 23:31
Location: Saarbrücken, Germany

Re: To subsitute specials characters

Postby Remiguel » 09.05.2015, 12:27

Hi Eva

Sorry to be so late. I forgot to active notification on that topic.
Please find the class below
class_datei_php.zip
(6.4 KiB) Downloaded 393 times
Remiguel
 
Posts: 96
Joined: 10.06.2014, 09:34
Location: Spain / France


Return to General

Who is online

Users browsing this forum: No registered users

cron