Fix select_db_table to handle properly 'valeur=0' commands
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 19 Oct 2010 21:18:00 +0000 (23:18 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 19 Oct 2010 21:18:00 +0000 (23:18 +0200)
empty() is an evil PHP function:
    empty($a['x']) is true if $a['x'] == 0...

Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
plugins/function.select_db_table.php

index 80f20a0..f9826fa 100644 (file)
@@ -57,7 +57,7 @@ function select_options($table, $value, $field, $pad, $where, $join, $group)
 }
 
 function smarty_function_select_db_table($params, &$smarty) {
-    if (empty($params['table']) || empty($params['valeur'])) {
+    if (empty($params['table']) || !array_key_exists('valeur', $params)) {
         return;
     }
     if (empty($params['champ'])) {