Forum Moderators: coopster
-----------code--------------------------------
function make_text_safe($text){
//Charachters must be in ASCII and certain ones aint allowed
$text = preg_replace("#&\#([0-9]*);#ie","_",$text);
$text = html_entity_decode ($text);
$text = str_replace(" / ","_",$text);
$text = str_replace("/","_",$text);
$text = str_replace("'","_",$text);
$text = str_replace(" - ","_",$text);
$text = str_replace("-","_",$text);
$text = str_replace(" ","_",$text);
$text = str_replace( "ä", "ae", $text);
$text = str_replace( "ö", "oe", $text);
$text = str_replace( "ü", "ue", $text);
$text = str_replace( "Ä", "Ae", $text);
$text = str_replace( "Ö", "Oe", $text);
$text = str_replace( "Ü", "Ue", $text);
$text = str_replace( "ß", "ss", $text);
$text = str_replace( "&", "and", $text);
$text = str_replace( "%", "Percent", $text);
//Polish Characters
$text = str_replace( "?", "l", $text);
$text = str_replace( "ó", "o", $text);
$text = str_replace( "?", "n", $text);
$text = str_replace( "?", "c", $text);
$text = str_replace( "?", "z", $text);
$text = str_replace( "?", "z", $text);
$text = str_replace( "?", "s", $text);
$text = str_replace( "?", "a", $text);
$text = str_replace( "?", "e", $text);
$text = ereg_replace("[^A-Za-z0-9_]", "", $text);
$text = str_replace("____","_",$text);
$text = str_replace("___","_",$text);
$text = str_replace("__","_",$text);
return $text;
--------------end of code------------------------
Obviously I tried this:
$text = str_replace(" ","-",$text); (I replaced the second pair of quotes containing the _ with a dash. This did not work. It merged everything into one long string. For some reason, only numbers, letters, and the stupid underscore work. The dash, period, and comma do not work.
Along with this file is just a shorter htaccess file, but I don't think the htaccess has anything to do with this.
Can someone please help me out?