Skip to content

Commit

Permalink
Merge pull request #273 from kstenschke/patch-1
Browse files Browse the repository at this point in the history
bugfix: possible invalid argument in media model
  • Loading branch information
partikule committed Jul 7, 2015
2 parents 13e0ba1 + 6c728c9 commit ad34369
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions application/models/media_model.php
Expand Up @@ -745,13 +745,15 @@ public function get_unused_files()
public function delete_files($files=array())
{
$nb = 0;

foreach ($files as $path)
if(is_array($files))
{
if (file_exists(FCPATH.$path))
foreach ($files as $path)
{
@unlink(FCPATH.$path);
}
if (file_exists(FCPATH.$path))
{
@unlink(FCPATH.$path);
}
}
}

return $nb;
Expand Down

0 comments on commit ad34369

Please sign in to comment.