From 8f9ed357e284a256d2f63de80f131b4162689754 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 6 Sep 2024 23:31:36 +0200 Subject: [PATCH] lib/php/db/field.php --- lib/php/db.php | 16 +++++++++------- lib/php/db/field.php | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) 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; } -- 2.47.3