Skip to content

Commit

Permalink
fixes #36 check conf isn't empty before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
HWFord committed Aug 24, 2022
1 parent 73015c2 commit 1ea3b5f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions maintain.class.php
Expand Up @@ -38,14 +38,17 @@ function install($plugin_version, &$errors=array())
global $conf, $prefixeTable;

// configuration
if (is_string($conf['batch_download']))
if (!empty($conf['batch_download']) and is_string($conf['batch_download']))
{
// Piwigo 11 has added an automatic espace of the word "groups" (new MySQL reserved keyword).
// Unserialize doesn't like the escaped `groups` at all, so we need to remove it
$conf['batch_download'] = str_replace('`groups`', 'groups', $conf['batch_download']);
}

$conf['batch_download'] = safe_unserialize($conf['batch_download']);
if (!empty($conf['batch_download']))
{
$conf['batch_download'] = safe_unserialize($conf['batch_download']);
}

if (empty($conf['batch_download']) or !isset($conf['batch_download']['last_clean']))
{
Expand Down

0 comments on commit 1ea3b5f

Please sign in to comment.