]> git.joonet.de Git - adminer.git/commitdiff
Use IS NULL operator for null value in where_link function
authorJakub Vrana <jakub@vrana.cz>
Tue, 8 Feb 2011 18:59:16 +0000 (19:59 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 8 Feb 2011 18:59:16 +0000 (19:59 +0100)
adminer/include/functions.inc.php
adminer/select.inc.php

index 75795c739e87a739e26f153bbc09f1ff9ca181a2..b71c4ead7aade22edcaa5d73a3a9b69697c54d1d 100644 (file)
@@ -302,7 +302,7 @@ function where_check($val) {
 * @return string
 */
 function where_link($i, $column, $value, $operator = "=") {
-       return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode($operator) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
+       return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode((isset($value) ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
 }
 
 /** Set cookie valid for 1 month
index d9f5621446d4c5badb6a8b32283634d4881f275f..0d8146120cc096fa3cbefc5e43477c1aa6e2585c 100644 (file)
@@ -336,7 +336,7 @@ if (!$columns) {
                                                                        }
                                                                }
                                                                foreach ($unique_array as $k => $v) {
-                                                                       $link .= h(where_link($i++, $k, $v, (isset($v) ? "=" : "IS NULL")));
+                                                                       $link .= h(where_link($i++, $k, $v));
                                                                }
                                                        }
                                                }