diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-04 16:22:27 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-04 16:22:27 +0000 |
commit | bc12477e061b6f076d1d719aa857c4eeaf0e6f2b (patch) | |
tree | 100f03bc0f3e65fed094a17818ee700e275ff7a0 /includes | |
parent | d1c46eadebd0650237322524afcb971addeebf44 (diff) | |
download | brdo-bc12477e061b6f076d1d719aa857c4eeaf0e6f2b.tar.gz brdo-bc12477e061b6f076d1d719aa857c4eeaf0e6f2b.tar.bz2 |
#173664 by fractile81: fix order of precedence in file_scan_directory(), so subtheme files will really override parent theme files
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc index 26227d529..b1b488d76 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -887,9 +887,11 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca while ($file = readdir($handle)) { if (!in_array($file, $nomask) && $file[0] != '.') { if (is_dir("$dir/$file") && $recurse) { - $files = array_merge($files, file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1)); + // Give priority to files in this folder by merging them in after any subdirectory files. + $files = array_merge(file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1), $files); } elseif ($depth >= $min_depth && ereg($mask, $file)) { + // Always use this match over anything already set in $files with the same $$key. $filename = "$dir/$file"; $basename = basename($file); $name = substr($basename, 0, strrpos($basename, '.')); |