Manual talk:$wgIllegalFileChars

From MediaWiki.org
Jump to navigation Jump to search

No problems[edit]

There's actually a lot of issues coming out of having ñÑ and accented characters in file titles. Think moving from Mysql to backups and back, etc, etc. I actually went through a damn nightmare thanks to the ñÑ's despite having a 20px message telling people to don't use those characters. Anyway, there use to be a message telling people the files were being renamed, whatever happened to that? How can I allow just aeiou 1234567890 AEIOU? Why in god's name anyone needs more than that? --Mark 09:50, 11 December 2009 (UTC)

And by the way, including this $wgIllegalFileChars = "áéíóúÁÉÍÓÚÑñ:"; doesn't have any effect on uploads. --Mark 09:52, 11 December 2009 (UTC)

Pour résoudre le problème modifier dans GlobalFunctions.php la procédure

function wfStripIllegalFilenameChars( $name ) {

   global $wgIllegalFileChars;
   $name = wfBaseName( $name );
## Modif par PC le 19 novembre 2010 pour supprimer les accents.
       $name = utf8_decode( $name );
       $accent='ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËéèêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñß';
       $noaccent='AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNns';
       $name = strtr($name,$accent,$noaccent);
       $name = utf8_encode( $name );
       $name = preg_replace("/[^".Title::legalChars()."]".($wgIllegalFileChars ? "|[".$wgIllegalFileChars."]":"")."/",'-',$name);
   return $name;

}

Thank you french guy for this patch! I included 'ß', works great! Flo --178.25.144.113 09:37, 17 October 2014 (UTC)