diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php index 3f73b400e80672576370ce9594e3c15b70b7133b..116bd8feb0bf5d2a100ae1829d50442912bfa5f7 100644 --- a/ecrire/public/criteres.php +++ b/ecrire/public/criteres.php @@ -631,6 +631,8 @@ function calculer_criteres ($idb, &$boucles) $boucle = $boucles[$idb]; $table = strtoupper($boucle->id_table); $defaut = charger_fonction('DEFAUT', 'calculer_critere'); + // s'il y avait une erreur de syntaxe, propager cette info + if (!is_array($boucle->criteres)) return array(); foreach($boucle->criteres as $crit) { $critere = $crit->op; // critere personnalise ? diff --git a/ecrire/public/phraser_html.php b/ecrire/public/phraser_html.php index 3a461813baa0394abda8e8ba712fbdfb4aae8ba2..805992f50b603ae5cec7179e55179b8db50483c4 100644 --- a/ecrire/public/phraser_html.php +++ b/ecrire/public/phraser_html.php @@ -421,6 +421,7 @@ function phraser_vieux(&$champ) // http://doc.spip.org/@phraser_criteres function phraser_criteres($params, &$result) { + $msg = ''; // indiquera s'il y a eu une erreur $args = array(); $type = $result->type_requete; $doublons = array(); @@ -556,7 +557,8 @@ function phraser_criteres($params, &$result) { // pour que la variable $doublon_index ait la bonne valeur // cf critere_doublon if ($doublons) $args= array_merge($args, $doublons); - $result->criteres = $args; + // Si erreur, laisser la chaine dans ce champ pour le HTTP 503 + if (!$msg) $result->criteres = $args; } // http://doc.spip.org/@phraser_critere_infixe