Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ereg to preg patch for Drupal 6.22 includes/files.inc
From 45eaed831098fe253b0089517b3bdc8ac51f8d66 Mon Sep 17 00:00:00 2001
From: Sofian Benaissa <sofian@koumbit.org>
Date: Wed, 26 Oct 2011 13:48:54 -0400
Subject: [PATCH] ereg to preg in file.inc
---
includes/file.inc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/includes/file.inc b/includes/file.inc
index f9c38b2..ea631af 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -959,7 +959,7 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca
// 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)) {
+ elseif ($depth >= $min_depth && preg_match("#$mask#", $file)) {
// Always use this match over anything already set in $files with the same $$key.
$filename = "$dir/$file";
$basename = basename($file);
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.