diff options
author | Gina Haeussge <osd@foosel.net> | 2008-10-11 17:36:46 +0200 |
---|---|---|
committer | Gina Haeussge <osd@foosel.net> | 2008-10-11 17:36:46 +0200 |
commit | 63b0c1a70fbc1d51a775e2fa30b6a520bac2a6e4 (patch) | |
tree | 175b90013c7acb77b5b49b6e5d177922152ebacd | |
parent | 2e79fc15a044f4d3e536b6498def4bec3fead1f0 (diff) | |
download | rpg-63b0c1a70fbc1d51a775e2fa30b6a520bac2a6e4.tar.gz rpg-63b0c1a70fbc1d51a775e2fa30b6a520bac2a6e4.tar.bz2 |
Fix for FS#1230
darcs-hash:20081011153646-2b4f5-4e4320b4bcb819e96a1ac7b8a83755c659b901b8.gz
-rw-r--r-- | inc/media.php | 2 | ||||
-rw-r--r-- | inc/pageutils.php | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/inc/media.php b/inc/media.php index 8a18e8b2e..ac0629b3f 100644 --- a/inc/media.php +++ b/inc/media.php @@ -245,7 +245,7 @@ function media_upload($ns,$auth){ } // get filename - $id = cleanID($ns.':'.$id); + $id = cleanID($ns.':'.$id,false,true); $fn = mediaFN($id); // get filetype regexp diff --git a/inc/pageutils.php b/inc/pageutils.php index 50e76d44e..abfca08de 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -86,8 +86,9 @@ function getID($param='id',$clean=true){ * @author Andreas Gohr <andi@splitbrain.org> * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII + * @param boolean $media Allow leading or trailing _ for media files */ -function cleanID($raw_id,$ascii=false){ +function cleanID($raw_id,$ascii=false,$media=false){ global $conf; global $lang; static $sepcharpat = null; @@ -126,7 +127,7 @@ function cleanID($raw_id,$ascii=false){ //clean up $id = preg_replace($sepcharpat,$sepchar,$id); $id = preg_replace('#:+#',':',$id); - $id = trim($id,':._-'); + $id = ($media ? trim($id,':.-') : trim($id,':._-')); $id = preg_replace('#:[:\._\-]+#',':',$id); $cache[(string)$raw_id] = $id; |