diff options
author | Michael Hamann <michael@content-space.de> | 2011-01-12 20:46:36 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-01-12 20:46:36 +0100 |
commit | ba0267b3bcb1b5feeb707e9a92766c4a619409bb (patch) | |
tree | 44cf659ea14de0b97cc7f45e0b3c69a8a9c309a8 /inc/pageutils.php | |
parent | 01032c33d1c2c00e6c2f04f0bdd9b9ac0057ded6 (diff) | |
download | rpg-ba0267b3bcb1b5feeb707e9a92766c4a619409bb.tar.gz rpg-ba0267b3bcb1b5feeb707e9a92766c4a619409bb.tar.bz2 |
Fix metaFiles for ids that require utf-8 escaping
Before this change metaFiles didn't return anything for ids where the
part without the namespace needs (utf-8) filename escaping.
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index 216debd9a..cd01dcae7 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -311,13 +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 = glob($dir.$name.'.*', GLOB_MARK); - return $files ? preg_grep('/^'.preg_quote($dir.$name, '/').'\.[^.\/]*$/u', $files) : array(); + $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(); } /** |