Skip to content

Commit

Permalink
Handle the case that JFolder::files returns 'false' (#11715)
Browse files Browse the repository at this point in the history
  • Loading branch information
okonomiyaki3000 authored and Michael Babker committed Apr 29, 2018
1 parent 116a507 commit a6e20f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libraries/src/Installer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1145,14 +1145,16 @@ public function parseSchemaUpdates(\SimpleXMLElement $schema, $eid)

if ($schemapath !== '')
{
$files = str_replace('.sql', '', \JFolder::files($this->getPath('extension_root') . '/' . $schemapath, '\.sql$'));
usort($files, 'version_compare');
$files = \JFolder::files($this->getPath('extension_root') . '/' . $schemapath, '\.sql$');

if (!count($files))
if (empty($files))
{
return $update_count;
}

$files = str_replace('.sql', '', $files);
usort($files, 'version_compare');

$query = $db->getQuery(true)
->select('version_id')
->from('#__schemas')
Expand Down

0 comments on commit a6e20f9

Please sign in to comment.