]> git.nbdom.net Git - nb.git/commitdiff
update for new php version
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 7 Oct 2024 07:27:47 +0000 (09:27 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 7 Oct 2024 07:27:47 +0000 (09:27 +0200)
etc/dbq/ldap.php
lib/php/db.php
lib/php/db/field.php
lib/php/db/table.php
www/dbq/dbq.php

index a88309fd73105f264d34f8eb7174d1423ec61af6..5c6f3e34b8edd498524e66be108754af1aaf538d 100644 (file)
@@ -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) {
index 12d668a6621f3baa5a1a0138a34713696170eaea..01e4fc025d50de6c7559266a2d7e7a6fe6f38519 100644 (file)
@@ -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([
index 91155c4d8e17472ea3b0ccf57efb333f39400301..93d4a10c92eb12ccf760399f95b17416398dc17a 100644 (file)
@@ -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");
index ded5214aca169fcefdf568a7b8d9f2da4e132757..8ba075d096d37fb06a0eb6524fcd70a8581191a8 100644 (file)
@@ -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;
index a62c30aa84cdc773c4a0ded5e2071eb265de2a6b..bf717f4f514dcab04862ee00bd28eaed8b11f20b 100644 (file)
@@ -95,6 +95,7 @@ class DbQ extends nb {
        public $table;
        public $db;
        private $conf;
+       private $_nopage;
 
        public function __construct($opt=[]) {
                //