]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/field.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 6 Sep 2024 21:31:36 +0000 (23:31 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 6 Sep 2024 21:31:36 +0000 (23:31 +0200)
lib/php/db.php
lib/php/db/field.php

index f9a99ebab8287ea291034542d1ebcd56c2f0c1ed..bbac9c9f1f925b51cc0abecbf4a56e2b4b134d25 100644 (file)
@@ -530,15 +530,17 @@ class Db extends nb {
                                $type = self::p('table-type',''); $type = $type ? explode(',',$type) : $type;
                                $name = self::p('table-name',''); $name = $name ? explode(',',$name) : $name;
 
-                               if ($rows = $this->conn->query($sql,PDO::FETCH_ASSOC)) foreach ($rows as $row) {
-                                       $tname = current($row);
+                               if ($rows = $this->conn->query($sql,PDO::FETCH_ASSOC)) {
+                                       foreach ($rows as $row) {
+                                               $tname = current($row);
 
-                                       # Filters
-                                       if (!empty($name) and !$this->str_match($row['name'],$name)) continue;
-                                       if (!empty($type) and !$this->str_match($row['type'],$type)) continue;
+                                               # Filters
+                                               if (!empty($name) and !$this->str_match($row['name'],$name)) continue;
+                                               if (!empty($type) and !$this->str_match($row['type'],$type)) continue;
 
-                                       # add to this->tables !!!
-                                       $t = $this->table($tname,$row+['status'=>$row]);
+                                               # add to this->tables !!!
+                                               $t = $this->table($tname,$row+['status'=>$row]);
+                                       }
                                }
                        }
 
index b71000a93f97e6c4befb48e3c83cc1ab52903eb3..1a10a4576adc45e1a9c5741742ee21adbaff5d71 100644 (file)
@@ -101,7 +101,8 @@ class field extends nb {
 
     if ($this->bool()) return preg_match('/^(1|yes|on|true)/i',$value) ? 'Yes' : 'No';
 
-               $value = Mime::html($value,$value,$mime);
+               # NB 06.09.24: field can be php code with already html  
+               if ($this->type != 'html') $value = Mime::html($value,$value,$mime);
     return $value;
   }