summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorMichal Rezler <rezlemic@fel.cvut.cz>2011-03-23 10:39:45 +0100
committerMichal Rezler <rezlemic@fel.cvut.cz>2011-03-23 10:39:45 +0100
commit35838d22a57707952f630eaf9f9e9ab4c6c3cfb0 (patch)
tree3603e2e56314af40a4b7922e14e52c0bc06f6f9d /inc/pageutils.php
parentc4bb7947fcb2d4a5e5f8a15d9e3bbec333e44e13 (diff)
parentee1214abb2c14cf0f86ff6d9a5b49536c6b01e18 (diff)
downloadrpg-35838d22a57707952f630eaf9f9e9ab4c6c3cfb0.tar.gz
rpg-35838d22a57707952f630eaf9f9e9ab4c6c3cfb0.tar.bz2
jQuery rewrite branch merged into master branch of whole project
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 42a485bdf..cd01dcae7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -311,14 +311,13 @@ function metaFN($id,$ext){
* returns an array of full paths to all metafiles of a given ID
*
* @author Esther Brunner <esther@kaffeehaus.ch>
+ * @author Michael Hamann <michael@content-space.de>
*/
function metaFiles($id){
- $name = noNS($id);
- $ns = getNS($id);
- $dir = ($ns) ? metaFN($ns,'').'/' : metaFN($ns,'');
- $files = array();
- $files = glob($dir.$name.'.*');
- return $files;
+ $basename = metaFN($id, '');
+ $files = glob($basename.'.*', GLOB_MARK);
+ // filter files like foo.bar.meta when $id == 'foo'
+ return $files ? preg_grep('/^'.preg_quote($basename, '/').'\.[^.\/]*$/u', $files) : array();
}
/**
@@ -344,10 +343,13 @@ function mediaFN($id){
*/
function localeFN($id){
global $conf;
- $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt';
+ $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.txt';
if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_INC.'inc/lang/en/'.$id.'.txt';
+ $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_INC.'inc/lang/en/'.$id.'.txt';
+ }
}
return $file;
}