summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/file.inc4
-rw-r--r--includes/unicode.inc4
2 files changed, 4 insertions, 4 deletions
diff --git a/includes/file.inc b/includes/file.inc
index b14c5b9..bbcf9dc 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -683,7 +683,7 @@ function file_validate_extensions($file, $extensions) {
// Bypass validation for uid = 1.
if ($user->uid != 1) {
- $regex = '/\.('. ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
+ $regex = '/\.('. @ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
if (!preg_match($regex, $file->filename)) {
$errors[] = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $extensions));
}
@@ -967,7 +967,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 && @ereg($mask, $file)) {
// Always use this match over anything already set in $files with the same $$key.
$filename = "$dir/$file";
$basename = basename($file);
diff --git a/includes/unicode.inc b/includes/unicode.inc
index 228981b..b1ce757 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -134,7 +134,7 @@ function drupal_xml_parser_create(&$data) {
}
// Check for an encoding declaration in the XML prolog if no BOM was found.
- if (!$bom && ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) {
+ if (!$bom && @ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) {
$encoding = $match[1];
}
@@ -144,7 +144,7 @@ function drupal_xml_parser_create(&$data) {
$out = drupal_convert_to_utf8($data, $encoding);
if ($out !== FALSE) {
$encoding = 'utf-8';
- $data = ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out);
+ $data = @ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out);
}
else {
watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), WATCHDOG_WARNING);