diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/common.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php index 9b91caca8..268072cbf 100644 --- a/inc/common.php +++ b/inc/common.php @@ -416,6 +416,21 @@ function wikiFN($id,$rev=''){ } /** + * returns the full path to the mediafile specified by ID + * + * The filename is URL encoded to protect Unicode chars + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +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 * |