Skip to content

Commit

Permalink
Merge pull request #132 from argiepiano/1.x-.1-x-issue-131
Browse files Browse the repository at this point in the history
Issue #131. Avoid using an empty string in explode.
  • Loading branch information
argiepiano committed Dec 12, 2023
2 parents ee91bbf + d21f546 commit 8dfb30f
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 8dfb30f

Please sign in to comment.