From 31af89ef53510a476247c58e08e8c5d2c8d1bfee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Aug 2023 13:26:24 +0200 Subject: [PATCH] Update list.php --- htdocs/cron/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 1125e107f45..fa28357d487 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -239,15 +239,15 @@ $pagetitle = $langs->trans("CronList"); llxHeader('', $pagetitle); -$sqlTest = 'SELECT DISTINCT test FROM '.MAIN_DB_PREFIX.'cronjob'; -$resultTest = $db->query($sqlTest); $TTestNotAllowed = array(); -if($resultTest) { +$sqlTest = 'SELECT rowid, test FROM '.MAIN_DB_PREFIX.'cronjob'; +$resultTest = $db->query($sqlTest); +if ($resultTest) { while ($objTest = $db->fetch_object($resultTest)) { $veriftest = verifCond($objTest->test); - if (!$veriftest) { - $TTestNotAllowed[] = $db->escape($objTest->test); - } + if (!$veriftest) { + $TTestNotAllowed[$objTest->id] = $objTest->id; + } } } @@ -285,8 +285,8 @@ $sql .= " t.libname,"; $sql .= " t.test"; $sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql .= " WHERE entity IN (0,".$conf->entity.")"; -if(!empty($TTestNotAllowed)) { - $sql .= ' AND test NOT IN ("'.implode('","',$TTestNotAllowed).'")'; +if (!empty($TTestNotAllowed)) { + $sql .= ' AND t.rowid NOT IN ('.$db->sanitize(implode(',', $TTestNotAllowed)).')'; } if ($search_status >= 0 && $search_status < 2 && $search_status != '') { $sql .= " AND t.status = ".(empty($search_status) ? '0' : '1');