summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-20 03:49:24 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-20 03:49:24 +0000
commit89b4c55989eb0a1d2263de3a4a78c179f458cfee (patch)
treea125af0b0636ecaf984673dffbfe91dccefcfa56 /includes
parent67f93fcb161f8ba5bb2c87626f3ef8874e7acffa (diff)
downloadbrdo-89b4c55989eb0a1d2263de3a4a78c179f458cfee.tar.gz
brdo-89b4c55989eb0a1d2263de3a4a78c179f458cfee.tar.bz2
#64967 follow-up by drewish: Replace ereg with preg in file_scan_directory().
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc6
-rw-r--r--includes/file.inc4
-rw-r--r--includes/install.inc4
-rw-r--r--includes/locale.inc4
-rw-r--r--includes/module.inc2
-rw-r--r--includes/registry.inc2
-rw-r--r--includes/theme.inc2
7 files changed, 12 insertions, 12 deletions
diff --git a/includes/common.inc b/includes/common.inc
index bbd3b8f80..50be5bb71 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1952,7 +1952,7 @@ function _drupal_load_stylesheet($matches) {
* Delete all cached CSS files.
*/
function drupal_clear_css_cache() {
- file_scan_directory(file_create_path('css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
+ file_scan_directory(file_create_path('css'), '/.*/', array('.', '..', 'CVS'), 'file_delete', TRUE);
}
/**
@@ -2325,7 +2325,7 @@ function drupal_build_js_cache($files, $filename) {
* Delete all cached JS files.
*/
function drupal_clear_js_cache() {
- file_scan_directory(file_create_path('js'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
+ file_scan_directory(file_create_path('js'), '/.*/', array('.', '..', 'CVS'), 'file_delete', TRUE);
variable_set('javascript_parsed', array());
}
@@ -2651,7 +2651,7 @@ function drupal_cron_cleanup() {
* version will be included.
*
* @param $mask
- * The regular expression of the files to find.
+ * The preg_match() regular expression of the files to find.
* @param $directory
* The subdirectory name in which the files are found. For example,
* 'modules' will search in both modules/ and
diff --git a/includes/file.inc b/includes/file.inc
index 7770b9244..e15aa3925 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -962,7 +962,7 @@ function file_download() {
* @param $dir
* The base directory for the scan, without trailing slash.
* @param $mask
- * The regular expression of the files to find.
+ * The preg_match() regular expression of the files to find.
* @param $nomask
* An array of files/directories to ignore.
* @param $callback
@@ -997,7 +997,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";
diff --git a/includes/install.inc b/includes/install.inc
index 3aea5b855..3bf434ebd 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -409,7 +409,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
function drupal_get_install_files($module_list = array()) {
$installs = array();
foreach ($module_list as $module) {
- $installs = array_merge($installs, drupal_system_listing($module . '.install$', 'modules'));
+ $installs = array_merge($installs, drupal_system_listing('/'. $module . '.install$/', 'modules'));
}
return $installs;
}
@@ -442,7 +442,7 @@ function drupal_verify_profile($profile, $locale) {
// Get a list of modules that exist in Drupal's assorted subdirectories.
$present_modules = array();
- foreach (drupal_system_listing('\.module$', 'modules', 'name', 0) as $present_module) {
+ foreach (drupal_system_listing('/\.module$/', 'modules', 'name', 0) as $present_module) {
$present_modules[] = $present_module->name;
}
diff --git a/includes/locale.inc b/includes/locale.inc
index 483497a6f..b06390265 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -2479,7 +2479,7 @@ function locale_batch_by_language($langcode, $finished = NULL, $skip = array())
// with names ending with $langcode.po. This allows for filenames
// like node-module.de.po to let translators use small files and
// be able to import in smaller chunks.
- $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)' . $langcode . '\.po$', array('.', '..', 'CVS'), 0, FALSE));
+ $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '/(^|\.)' . $langcode . '\.po$/', array('.', '..', 'CVS'), 0, FALSE));
$components[] = $component->name;
}
@@ -2511,7 +2511,7 @@ function locale_batch_by_component($components, $finished = '_locale_batch_syste
// as $langcode.po or with names ending with $langcode.po. This allows
// for filenames like node-module.de.po to let translators use small
// files and be able to import in smaller chunks.
- $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)(' . $language_list . ')\.po$', array('.', '..', 'CVS'), 0, FALSE));
+ $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '/(^|\.)(' . $language_list . ')\.po$/', array('.', '..', 'CVS'), 0, FALSE));
}
}
return _locale_batch_build($files, $finished);
diff --git a/includes/module.inc b/includes/module.inc
index a1aa899b6..2a131d81f 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -80,7 +80,7 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_
*/
function module_rebuild_cache() {
// Get current list of modules
- $files = drupal_system_listing('\.module$', 'modules', 'name', 0);
+ $files = drupal_system_listing('/\.module$/', 'modules', 'name', 0);
// Extract current files from database.
system_get_files_database($files, 'module');
diff --git a/includes/registry.inc b/includes/registry.inc
index 636687136..e306c8487 100644
--- a/includes/registry.inc
+++ b/includes/registry.inc
@@ -49,7 +49,7 @@ function _registry_rebuild() {
}
}
}
- foreach (file_scan_directory('includes', '\.inc$') as $filename => $file) {
+ foreach (file_scan_directory('includes', '/\.inc$/') as $filename => $file) {
$files["./$filename"] = array();
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 4121937e4..2ad9f2e6e 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -790,7 +790,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array();
// Escape the periods in the extension.
- $regex = str_replace('.', '\.', $extension) . '$';
+ $regex = '/'. str_replace('.', '\.', $extension) . '$/';
// Because drupal_system_listing works the way it does, we check for real
// templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0);