From: Nicolas Iooss Date: Sun, 29 Dec 2013 11:03:52 +0000 (+0100) Subject: Fix PHP Notice: Array to string conversion in validate.inc.php X-Git-Tag: xorg/1.1.11~11 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1b5f4ba2b95367fcd376ae3847e002b915409732;p=platal.git Fix PHP Notice: Array to string conversion in validate.inc.php Validate::iterate() builds a SQL query that involves an array of WHERE filters. When this array is empty, it was incorrectly kept as is, thus triggering a PHP Notice. Note: this error is not fatal as the following statement is a valid SQL query: SELECT data, DATE_FORMAT(stamp, "%Y%m%d%H%i%s") FROM requests Array ORDER BY stamp; --- diff --git a/include/validations.inc.php b/include/validations.inc.php index 390e81b..2840965 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -440,6 +440,8 @@ abstract class Validate } if (!empty($where)) { $where = 'WHERE ' . implode('AND', $where); + } else { + $where = ''; } $it = XDB::iterRow('SELECT data, DATE_FORMAT(stamp, "%Y%m%d%H%i%s") FROM requests