From 63ba0b075ea9777ce1a62d1a2c50952cde94859b Mon Sep 17 00:00:00 2001 From: andi Date: Wed, 13 Apr 2005 22:04:38 +0200 Subject: new file to add ACL checks on media files #204 (incomplete yet) darcs-hash:20050413200438-9977f-7b75da8fcdd239f3ef9658e8c487e998e619e9d2.gz --- inc/common.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 9b91caca8..268072cbf 100644 --- a/inc/common.php +++ b/inc/common.php @@ -415,6 +415,21 @@ function wikiFN($id,$rev=''){ return $fn; } +/** + * returns the full path to the mediafile specified by ID + * + * The filename is URL encoded to protect Unicode chars + * + * @author Andreas Gohr + */ +function mediaFN($id){ + global $conf; + $id = cleanID($id); + $id = str_replace(':','/',$id); + $fn = $conf['datadir'].'/'.utf8_encodeFN($id); + return $fn; +} + /** * Returns the full filepath to a localized textfile if local * version isn't found the english one is returned -- cgit v1.2.3