From d21f54662c774ac89800e30dcb5a5fcd33e6f8f0 Mon Sep 17 00:00:00 2001 From: argiepiano Date: Sun, 10 Dec 2023 14:44:30 -0700 Subject: [PATCH] Issue #131. Avoid using an empty string in explode. Fixes #13. --- includes/files.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/files.inc b/includes/files.inc index d20d9fa..e7b31ef 100644 --- a/includes/files.inc +++ b/includes/files.inc @@ -518,7 +518,9 @@ class backup_file { function set_file_info($file_info) { $this->file_info = $file_info; - $this->ext = explode('.', @$this->file_info['filename']); + if (!empty($this->file_info['filename'])) { + $this->ext = explode('.', $this->file_info['filename']); + } // Remove the underscores added to file extensions by Drupal's upload security. foreach ($this->ext as $key => $val) { $this->ext[$key] = trim($val, '_');