summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 68fa2c23b..1be451823 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -658,7 +658,7 @@ function file_validate_extensions($file, $extensions) {
// Bypass validation for uid = 1.
if ($user->uid != 1) {
- $regex = '/\.(' . ereg_replace(' +', '|', preg_quote($extensions)) . ')$/i';
+ $regex = '/\.(' . preg_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));
}