diff options
author | andi <andi@splitbrain.org> | 2005-05-30 20:10:55 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-05-30 20:10:55 +0200 |
commit | 156a608c0ca9fae2f48bf7322133edefaf93633f (patch) | |
tree | fe373c16aa64fd6372641f06f8abc6e5aa69026f | |
parent | e09875dbfe0a4db06ec7573d954b8403e916bba9 (diff) | |
download | rpg-156a608c0ca9fae2f48bf7322133edefaf93633f.tar.gz rpg-156a608c0ca9fae2f48bf7322133edefaf93633f.tar.bz2 |
keep txt extension on uploaded txt files #360
darcs-hash:20050530181055-9977f-9a771ac829c8fe48557f6932cc99fd4318579a9e.gz
-rw-r--r-- | inc/search.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/search.php b/inc/search.php index df3c74fcd..853faef8a 100644 --- a/inc/search.php +++ b/inc/search.php @@ -163,7 +163,7 @@ function search_media(&$data,$base,$file,$type,$lvl,$opts){ if($type == 'd') return false; $info = array(); - $info['id'] = pathID($file); + $info['id'] = pathID($file,true); //check ACL for namespace (we have no ACL for mediafiles) if(auth_quickaclcheck(getNS($info['id']).':*') < AUTH_READ){ @@ -353,10 +353,10 @@ function sort_search_fulltext($a,$b){ * @author Andreas Gohr <andi@splitbrain.org> * @todo move to pageutils */ -function pathID($path){ +function pathID($path,$keeptxt=false){ $id = utf8_decodeFN($path); $id = str_replace('/',':',$id); - $id = preg_replace('#\.txt$#','',$id); + if(!$keeptxt) $id = preg_replace('#\.txt$#','',$id); $id = preg_replace('#^:+#','',$id); $id = preg_replace('#:+$#','',$id); return $id; |