Snad opravena husta haluz s duck-typingem
authorThomas Mudrunka <tomas@mudrunka.cz>
Mon, 12 Mar 2012 17:56:31 +0000 (18:56 +0100)
committerThomas Mudrunka <tomas@mudrunka.cz>
Mon, 12 Mar 2012 17:56:31 +0000 (18:56 +0100)
index.php

index ba252042a98f7295dd2beebdf181eae6d2bc8e49..702c3beb9c5f44dd77273109c76ff92d8dcc36c4 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -118,7 +118,7 @@ class HTML {
                //echo('<pre>'); print_r($selectbox);
                $html = "<select name='$name'>";
 
-               if($default) {
+               if(!is_bool($default)) {
                        $value=$default; $title=$selectbox[$value];
                        $html .= "<option value='$value'>$value :: $title</option>";
                        unset($selectbox[$value]);
@@ -445,7 +445,7 @@ EOF;
                        $val = $update && isset($current[$column['Field']]) ? $current[$column['Field']] : false;
                        switch(true) {
                                case (preg_match('/auto_increment/', $column['Extra']) || in_array($column['Field'], $hidecols)):
-                                       if(!$val) $val = '';
+                                       if(is_bool($val) && !$val) $val = '';
                                        $html.=$this->input($name, $val, 'hidden');
                                        $html.=$val.'(AUTO)';
                                        break;
This page took 0.134343 seconds and 4 git commands to generate.