// 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));
}
// 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);
}
// 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];
}
$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);