From: Nicolas Boisselier Date: Mon, 7 Oct 2024 07:27:47 +0000 (+0200) Subject: update for new php version X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=84ebd9f70c37f00692854697eb263cb1322f897f;p=nb.git update for new php version --- diff --git a/etc/dbq/ldap.php b/etc/dbq/ldap.php index a88309fd..5c6f3e34 100644 --- a/etc/dbq/ldap.php +++ b/etc/dbq/ldap.php @@ -43,7 +43,7 @@ $GLOBALS['DBQ_LDAP'] = [ ]; #'(&('.$search['filter'].')(userPassword=*))' -if (preg_match('/^([^,]+),(.*?)$/',$user,$m)) { +if ($user and preg_match('/^([^,]+),(.*?)$/',$user,$m)) { $filter = $m[1]; } elseif($user) { diff --git a/lib/php/db.php b/lib/php/db.php index 12d668a6..01e4fc02 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -171,8 +171,11 @@ class Db extends nb { } # Args into this - foreach ($opt as $k=>$v) $this->$k = $v; + # NB 07.10.24 foreach ($opt as $k=>$v) $this->$k = $v; #parent::__construct($opt); + foreach ($opt as $k => $v) { + if (property_exists($this,$k)) $this->$k = $v; + } # Out Class if (empty($this->out)) $this->out = new Out([ diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 91155c4d..93d4a10c 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -9,8 +9,9 @@ class field extends nb { public $key = 0; public $uniq = 0; public $index = 0; + public $dyn = 0; public $size; - public $default; + public $default = ''; public $autoincrement; public $extra; public $extras; @@ -40,10 +41,6 @@ class field extends nb { # NB 06.02.18 Bug if ($this->default == "''") $this->default = ''; if ($default === null) $default = $this->default; -# NB 12.12.17 if (strtoupper($default) == "NULL") $default = null; - #if (strtoupper($default) == "NOW()") $default = null; -# NB 08.01.18 if (strtoupper($default) == "NOW()") $default = $date_microtime(); -# NB 08.01.18 if (strtoupper($default) == "CURRENT_TIMESTAMP") $default = $date_microtime(); if (strtoupper($default) == "NOW()") $default = date("Y-m-d H:i:s.u"); if (strtoupper($default) == "CURRENT_TIMESTAMP") $default = date("Y-m-d H:i:s.u"); if (strtoupper($default) == "CURRENT_DATE") $default = date("Y-m-d"); diff --git a/lib/php/db/table.php b/lib/php/db/table.php index ded5214a..8ba075d0 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -511,7 +511,8 @@ Class Table extends nb { $params = []; foreach ($keys as $k) { $params[$k] = self::p($k); - $params[$k] = urlencode( $params[$k] ); # NB 13.02.24: could contains qutoe, spaces, ... eg: orderby + if (!$params[$k]) continue; + $params[$k] = urlencode( $params[$k] ); # NB 13.02.24: could contains auote, spaces, ... eg: orderby if (!isset($params[$k]) or (string)$params[$k] === '') unset($params[$k]); } return $params; diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index a62c30aa..bf717f4f 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -95,6 +95,7 @@ class DbQ extends nb { public $table; public $db; private $conf; + private $_nopage; public function __construct($opt=[]) { //