Skip to content

Commit

Permalink
Issue #131. Avoid using an empty string in explode.
Browse files Browse the repository at this point in the history
Fixes #13.
  • Loading branch information
argiepiano committed Dec 10, 2023
1 parent ee91bbf commit d21f546
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/files.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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, '_');
Expand Down

0 comments on commit d21f546

Please sign in to comment.