From: Nicolas Boisselier Date: Fri, 6 Sep 2024 21:31:36 +0000 (+0200) Subject: lib/php/db/field.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=8f9ed357e284a256d2f63de80f131b4162689754;p=nb.git lib/php/db/field.php --- diff --git a/lib/php/db.php b/lib/php/db.php index f9a99eba..bbac9c9f 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -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]); + } } } diff --git a/lib/php/db/field.php b/lib/php/db/field.php index b71000a9..1a10a457 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -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; }