diff options
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index 73be0a3a8..53e5b2aba 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -65,8 +65,10 @@ function getID($param='id',$clean=true){ * converted to unaccented ones * * @author Andreas Gohr <andi@splitbrain.org> + * @param string $id The pageid to clean + * @param boolean $ascii Force ASCII */ -function cleanID($id){ +function cleanID($id,$ascii=false){ global $conf; global $lang; static $sepcharpat = null; @@ -86,11 +88,14 @@ function cleanID($id){ $id = strtr($id,'/',$sepchar); } - if($conf['deaccent']) $id = utf8_deaccent($id,-1); + if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id); + if($conf['deaccent'] || $ascii) $id = utf8_deaccent($id,-1); //remove specials $id = utf8_stripspecials($id,$sepchar,'\*'); + if($ascii) $id = utf8_strip($id); + //clean up $id = preg_replace($sepcharpat,$sepchar,$id); $id = preg_replace('#:+#',':',$id); |