From 5ae00086e5e4a5ffe979d5462b388d8277417e9f Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 18 Feb 2022 23:43:09 +0100 Subject: [PATCH 1/9] fix some warnings from modern PHP versions --- classes/document.php-class | 2 +- classes/useragent.php-class | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/classes/document.php-class b/classes/document.php-class index 198296f..ed688b6 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -439,7 +439,7 @@ class ExtendedDocument extends DOMDocument { public function createElement($name, $value = '') { // Adding the $value in DOMDocument's createElement does NOT escape it, so override it and use appendText to support that. $aelem = parent::createElement($name); - if (strlen($value)) { $aelem->appendText($value); } + if (strlen($value ?? '')) { $aelem->appendText($value); } return $aelem; } diff --git a/classes/useragent.php-class b/classes/useragent.php-class index efda352..bebf553 100755 --- a/classes/useragent.php-class +++ b/classes/useragent.php-class @@ -1003,12 +1003,17 @@ class userAgent { public function getAcceptLanguages() { if (!isset($this->uadata['accept-languages'])) { $headers = getAllHeaders(); - $accLcomp = explode(',', @$headers['Accept-Language']); + $accLcomp = explode(',', ($headers['Accept-Language'] ?? '')); $accLang = array(); foreach ($accLcomp as $lcomp) { if (strlen($lcomp)) { $ldef = explode(';', $lcomp); - $accLang[$ldef[0]] = (float)((strpos(@$ldef[1],'q=')===0)?substr($ldef[1],2):1); + if (count($ldef) > 1 && strpos($ldef[1], 'q=') === 0) { + $accLang[$ldef[0]] = substr($ldef[1], 2); + } + else { + $accLang[$ldef[0]] = 1; + } } } $this->uadata['accept-languages'] = $accLang; @@ -1549,7 +1554,7 @@ class userAgent { if (strpos($this->uadata['os'], 'Windows Phone OS') !== false) { $this->mobile = true; } elseif (strpos($this->uadata['os'], 'Gameboy') !== false) { $this->mobile = true; } - $this->uadata['lang'] = str_replace('_', '-', @$this->uadata['lang']); + $this->uadata['lang'] = str_replace('_', '-', ($this->uadata['lang'] ?? '')); } } return $this->uadata['os']; -- 2.35.3 From e78a75387d67c9293ba7dbd7dbd846b729f1ff19 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sat, 7 Jan 2023 18:16:27 +0100 Subject: [PATCH 2/9] short array syntax, standard return indentation, fix warnings --- classes/useragent.php-class | 133 ++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 60 deletions(-) diff --git a/classes/useragent.php-class b/classes/useragent.php-class index bebf553..9c95c6d 100755 --- a/classes/useragent.php-class +++ b/classes/useragent.php-class @@ -97,7 +97,7 @@ class userAgent { private $version; private $bot = false; private $mobile = false; - private $uadata = array(); + private $uadata = []; function __construct($ua_string = '') { // *** constructor *** @@ -980,12 +980,14 @@ class userAgent { $this->bot = false; } - $botArray = array('Scooter','Spinne','Vagabondo','Firefly','Scrubby','NG','Pompos','Szukacz','Schmozilla','42_HAL', - 'NetResearchServer','LinkWalker','Zeus','W3C_Validator','ZyBorg','Ask Jeeves','ia_archiver', - 'PingALink Monitoring Services','IlTrovatore-Setaccio','Nutch','Mercator','search.ch', - 'appie','larbin','NutchCVS','Webchat','Mediapartners-Google','sitecheck.internetseer.com', - 'FavOrg','findlinks','DataCha0s','ichiro','Francis','CoralWebPrx','DoCoMo','Ocelli','Sogou Video', - 'Yandex','Yeti','Austronaut-URL-Checker'); + $botArray = [ + 'Scooter', 'Spinne', 'Vagabondo', 'Firefly', 'Scrubby', 'NG', 'Pompos', 'Szukacz', 'Schmozilla', '42_HAL', + 'NetResearchServer', 'LinkWalker', 'Zeus', 'W3C_Validator', 'ZyBorg', 'Ask Jeeves', 'ia_archiver', + 'PingALink Monitoring Services', 'IlTrovatore-Setaccio', 'Nutch', 'Mercator', 'search.ch', + 'appie', 'larbin', 'NutchCVS', 'Webchat', 'Mediapartners-Google', 'sitecheck.internetseer.com', + 'FavOrg', 'findlinks', 'DataCha0s', 'ichiro', 'Francis', 'CoralWebPrx', 'DoCoMo', 'Ocelli', 'Sogou Video', + 'Yandex', 'Yeti', 'Austronaut-URL-Checker' + ]; if (in_array($this->brand, $botArray)) { $this->bot = true; @@ -997,14 +999,19 @@ class userAgent { } } - public function getBrand() { return $this->brand; } - public function getVersion() { return $this->version; } + public function getBrand() { + return $this->brand; + } + + public function getVersion() { + return $this->version; + } public function getAcceptLanguages() { if (!isset($this->uadata['accept-languages'])) { $headers = getAllHeaders(); $accLcomp = explode(',', ($headers['Accept-Language'] ?? '')); - $accLang = array(); + $accLang = []; foreach ($accLcomp as $lcomp) { if (strlen($lcomp)) { $ldef = explode(';', $lcomp); @@ -1018,10 +1025,12 @@ class userAgent { } $this->uadata['accept-languages'] = $accLang; } - return $this->uadata['accept-languages']; + return $this->uadata['accept-languages']; } - public function getUAString() { return $this->uastring; } + public function getUAString() { + return $this->uastring; + } public function getEngine() { // return gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|icestorm|netfront|unknown @@ -1106,10 +1115,12 @@ class userAgent { } } } - return $this->uadata['engine']; + return $this->uadata['engine']; } - public function hasEngine($rnd_engine) { return ($this->getEngine() == $rnd_engine); } + public function hasEngine($rnd_engine) { + return ($this->getEngine() == $rnd_engine); + } public function getEngineVersion() { if (!isset($this->uadata['eng_version'])) { @@ -1117,7 +1128,7 @@ class userAgent { // getOS() should get the date for us $this->getOS(); } - return $this->uadata['eng_version']; + return $this->uadata['eng_version']; } public function getOS() { @@ -1507,57 +1518,57 @@ class userAgent { elseif (preg_match('/iPhone OS ([\d_]+)/i', $this->uadata['os'], $regs)) { $this->uadata['os'] = 'iOS '.str_replace('_', '.', $regs[1]); } elseif (preg_match('/Mac ?OS ?X/i', $this->uadata['os'])) { $this->uadata['os'] = 'MacOS X'; } elseif (preg_match('/Mac_P(ower|)PC/i', $this->uadata['os'])) { $this->uadata['os'] = 'MacOS'; } - elseif (strpos($this->uadata['os'], 'darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } - elseif (strpos($this->uadata['os'], 'Darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } - elseif (strpos($this->uadata['os'], 'apple') !== false) { $this->uadata['os'] = 'MacOS'; } - elseif (strpos($this->uadata['os'], 'Macintosh') !== false) { $this->uadata['os'] = 'MacOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } + elseif (strpos($this->uadata['os'] ?? '', 'Darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } + elseif (strpos($this->uadata['os'] ?? '', 'apple') !== false) { $this->uadata['os'] = 'MacOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'Macintosh') !== false) { $this->uadata['os'] = 'MacOS'; } elseif (preg_match('/(?:web|hpw)OS\/([0-9a-zA-Z\._+]+)/i', $this->uadata['os'], $regs)) { $this->uadata['os'] = 'webOS '.$regs[1]; } elseif (preg_match('/Android \(Linux (.+)\)/i', $this->uadata['os'], $regs)) { $this->uadata['os'] = 'Android '.$regs[1]; } - elseif (strpos($this->uadata['os'], 'linux') !== false) { $this->uadata['os'] = 'Linux'; } + elseif (strpos($this->uadata['os'] ?? '', 'linux') !== false) { $this->uadata['os'] = 'Linux'; } elseif (preg_match('/SymbianOS[\/ ]([0-9a-zA-Z\._+]+)/i', $this->uastring, $regs)) { $this->uadata['os'] = 'SymbianOS '.$regs[1]; } elseif (preg_match('/Symbian ?OS/i', $this->uadata['os'])) { $this->uadata['os'] = 'SymbianOS'; } - if (strpos($this->uadata['os'], 'Win') !== false) { $this->uadata['platform'] = 'Windows'; } - elseif (strpos($this->uadata['os'], 'Mac') !== false) { $this->uadata['platform'] = 'Macintosh'; } - elseif (strpos($this->uadata['os'], 'iOS') !== false) { $this->uadata['platform'] = 'Macintosh'; } - elseif (strpos($this->uadata['os'], 'Linux') !== false) { $this->uadata['platform'] = 'Linux'; } - elseif (strpos($this->uadata['os'], 'MeeGo') !== false) { $this->uadata['platform'] = 'Linux'; } - elseif (strpos($this->uadata['os'], 'webOS') !== false) { $this->uadata['platform'] = 'Linux'; } - elseif (strpos($this->uadata['os'], 'Android') !== false) { $this->uadata['platform'] = 'Android'; } - elseif (strpos($this->uadata['os'], 'Firefox OS') !== false) { $this->uadata['platform'] = 'Firefox OS'; } - elseif (strpos($this->uadata['os'], 'Solaris') !== false) { $this->uadata['platform'] = 'Solaris'; } - elseif (strpos($this->uadata['os'], 'SunOS') !== false) { $this->uadata['platform'] = 'Solaris'; } - elseif (strpos($this->uadata['os'], 'BeOS') !== false) { $this->uadata['platform'] = 'BeOS'; } - elseif (strpos($this->uadata['os'], 'BePC') !== false) { $this->uadata['platform'] = 'BeOS'; } - elseif (strpos($this->uadata['os'], 'FreeBSD') !== false) { $this->uadata['platform'] = 'FreeBSD'; } - elseif (strpos($this->uadata['os'], 'OpenBSD') !== false) { $this->uadata['platform'] = 'OpenBSD'; } - elseif (strpos($this->uadata['os'], 'NetBSD') !== false) { $this->uadata['platform'] = 'NetBSD'; } - elseif (strpos($this->uadata['os'], 'AIX') !== false) { $this->uadata['platform'] = 'AIX'; } - elseif (strpos($this->uadata['os'], 'IRIX') !== false) { $this->uadata['platform'] = 'IRIX'; } - elseif (strpos($this->uadata['os'], 'HP-UX') !== false) { $this->uadata['platform'] = 'HP-UX'; } - elseif (strpos($this->uadata['os'], 'AmigaOS') !== false) { $this->uadata['platform'] = 'Amiga'; } - elseif (strpos($this->uadata['os'], 'webOS') !== false) { $this->uadata['platform'] = 'webOS'; } - elseif (strpos($this->uadata['os'], 'Commodore 64') !== false) { $this->uadata['platform'] = 'C64'; } - elseif (strpos($this->uadata['os'], 'OpenVMS') !== false) { $this->uadata['platform'] = 'OpenVMS'; } - elseif (strpos($this->uadata['os'], 'Warp') !== false) { $this->uadata['platform'] = 'OS/2'; } - elseif (strpos($this->uadata['os'], 'OS/2') !== false) { $this->uadata['platform'] = 'OS/2'; } - elseif (strpos($this->uadata['os'], 'SymbianOS') !== false) { $this->uadata['platform'] = 'SymbianOS'; } - elseif (strpos($this->uadata['os'], 'BlackBerry') !== false) { $this->uadata['platform'] = 'BlackBerry'; } - elseif (strpos($this->uadata['os'], 'Gameboy') !== false) { $this->uadata['platform'] = 'Nintendo'; } - elseif (strpos($this->uadata['os'], 'Wii') !== false) { $this->uadata['platform'] = 'Nintendo'; } - elseif (strpos($this->uadata['os'], 'Nintendo') !== false) { $this->uadata['platform'] = 'Nintendo'; } - elseif (strpos($this->uadata['os'], 'J2ME') !== false) { $this->uadata['platform'] = 'Java'; } - elseif (strpos($this->uadata['os'], 'CYGWIN') !== false) { $this->uadata['platform'] = 'Windows'; } - elseif (strpos($this->uadata['os'], 'mingw') !== false) { $this->uadata['platform'] = 'Windows'; } + if (strpos($this->uadata['os'] ?? '', 'Win') !== false) { $this->uadata['platform'] = 'Windows'; } + elseif (strpos($this->uadata['os'] ?? '', 'Mac') !== false) { $this->uadata['platform'] = 'Macintosh'; } + elseif (strpos($this->uadata['os'] ?? '', 'iOS') !== false) { $this->uadata['platform'] = 'Macintosh'; } + elseif (strpos($this->uadata['os'] ?? '', 'Linux') !== false) { $this->uadata['platform'] = 'Linux'; } + elseif (strpos($this->uadata['os'] ?? '', 'MeeGo') !== false) { $this->uadata['platform'] = 'Linux'; } + elseif (strpos($this->uadata['os'] ?? '', 'webOS') !== false) { $this->uadata['platform'] = 'Linux'; } + elseif (strpos($this->uadata['os'] ?? '', 'Android') !== false) { $this->uadata['platform'] = 'Android'; } + elseif (strpos($this->uadata['os'] ?? '', 'Firefox OS') !== false) { $this->uadata['platform'] = 'Firefox OS'; } + elseif (strpos($this->uadata['os'] ?? '', 'Solaris') !== false) { $this->uadata['platform'] = 'Solaris'; } + elseif (strpos($this->uadata['os'] ?? '', 'SunOS') !== false) { $this->uadata['platform'] = 'Solaris'; } + elseif (strpos($this->uadata['os'] ?? '', 'BeOS') !== false) { $this->uadata['platform'] = 'BeOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'BePC') !== false) { $this->uadata['platform'] = 'BeOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'FreeBSD') !== false) { $this->uadata['platform'] = 'FreeBSD'; } + elseif (strpos($this->uadata['os'] ?? '', 'OpenBSD') !== false) { $this->uadata['platform'] = 'OpenBSD'; } + elseif (strpos($this->uadata['os'] ?? '', 'NetBSD') !== false) { $this->uadata['platform'] = 'NetBSD'; } + elseif (strpos($this->uadata['os'] ?? '', 'AIX') !== false) { $this->uadata['platform'] = 'AIX'; } + elseif (strpos($this->uadata['os'] ?? '', 'IRIX') !== false) { $this->uadata['platform'] = 'IRIX'; } + elseif (strpos($this->uadata['os'] ?? '', 'HP-UX') !== false) { $this->uadata['platform'] = 'HP-UX'; } + elseif (strpos($this->uadata['os'] ?? '', 'AmigaOS') !== false) { $this->uadata['platform'] = 'Amiga'; } + elseif (strpos($this->uadata['os'] ?? '', 'webOS') !== false) { $this->uadata['platform'] = 'webOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'Commodore 64') !== false) { $this->uadata['platform'] = 'C64'; } + elseif (strpos($this->uadata['os'] ?? '', 'OpenVMS') !== false) { $this->uadata['platform'] = 'OpenVMS'; } + elseif (strpos($this->uadata['os'] ?? '', 'Warp') !== false) { $this->uadata['platform'] = 'OS/2'; } + elseif (strpos($this->uadata['os'] ?? '', 'OS/2') !== false) { $this->uadata['platform'] = 'OS/2'; } + elseif (strpos($this->uadata['os'] ?? '', 'SymbianOS') !== false) { $this->uadata['platform'] = 'SymbianOS'; } + elseif (strpos($this->uadata['os'] ?? '', 'BlackBerry') !== false) { $this->uadata['platform'] = 'BlackBerry'; } + elseif (strpos($this->uadata['os'] ?? '', 'Gameboy') !== false) { $this->uadata['platform'] = 'Nintendo'; } + elseif (strpos($this->uadata['os'] ?? '', 'Wii') !== false) { $this->uadata['platform'] = 'Nintendo'; } + elseif (strpos($this->uadata['os'] ?? '', 'Nintendo') !== false) { $this->uadata['platform'] = 'Nintendo'; } + elseif (strpos($this->uadata['os'] ?? '', 'J2ME') !== false) { $this->uadata['platform'] = 'Java'; } + elseif (strpos($this->uadata['os'] ?? '', 'CYGWIN') !== false) { $this->uadata['platform'] = 'Windows'; } + elseif (strpos($this->uadata['os'] ?? '', 'mingw') !== false) { $this->uadata['platform'] = 'Windows'; } else { $this->uadata['platform'] = $this->uadata['os']; } - if (strpos($this->uadata['os'], 'Windows Phone OS') !== false) { $this->mobile = true; } - elseif (strpos($this->uadata['os'], 'Gameboy') !== false) { $this->mobile = true; } + if (strpos($this->uadata['os'] ?? '', 'Windows Phone OS') !== false) { $this->mobile = true; } + elseif (strpos($this->uadata['os'] ?? '', 'Gameboy') !== false) { $this->mobile = true; } $this->uadata['lang'] = str_replace('_', '-', ($this->uadata['lang'] ?? '')); } } - return $this->uadata['os']; + return $this->uadata['os']; } public function getPlatform() { @@ -1566,7 +1577,7 @@ class userAgent { // getOS() should get the date for us $this->getOS(); } - return $this->uadata['platform']; + return $this->uadata['platform']; } public function getLanguage() { @@ -1575,7 +1586,7 @@ class userAgent { // getOS() should get the date for us $this->getOS(); } - return $this->uadata['lang']; + return $this->uadata['lang']; } public function getGeckoDate() { @@ -1584,7 +1595,7 @@ class userAgent { // getEngine() should get the date for us $this->getEngine(); } - return $this->uadata['geckodate']; + return $this->uadata['geckodate']; } public function getGeckoTime() { @@ -1602,10 +1613,12 @@ class userAgent { if ($use_time) { date_default_timezone_set($old_tz); } } } - return $this->uadata['geckotime']; + return $this->uadata['geckotime']; } - public function isBot() { return $this->bot; } + public function isBot() { + return $this->bot; + } public function isMobile() { if (!isset($this->uadata['os'])) { -- 2.35.3 From fb10d8f6bc2f713233929e8d6923155597941a84 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sat, 7 Jan 2023 18:20:01 +0100 Subject: [PATCH 3/9] fix Gecko version for Firefox 110 and later --- classes/useragent.php-class | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/useragent.php-class b/classes/useragent.php-class index 9c95c6d..cf38a17 100755 --- a/classes/useragent.php-class +++ b/classes/useragent.php-class @@ -1229,6 +1229,9 @@ class userAgent { $this->uadata['lang'] = null; $this->uadata['eng_version'] = null; } + if (($this->brand == 'Firefox') && (intval($this->version) >= 110)) { + $this->uadata['eng_version'] = $this->version; + } } elseif ($this->hasEngine('edgehtml')) { if (preg_match('#Mozilla/5.0 \(([^;]+); (WOW64|Win64); ([^\);]+)\)#', $this->uastring, $regs)) { -- 2.35.3 From a6d14fe0a88283bd7e6a227421c4e66ba710d824 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 8 Jan 2023 16:48:18 +0100 Subject: [PATCH 4/9] update bot detection with a few more UA names --- classes/useragent.php-class | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/classes/useragent.php-class b/classes/useragent.php-class index cf38a17..6aea289 100755 --- a/classes/useragent.php-class +++ b/classes/useragent.php-class @@ -983,10 +983,11 @@ class userAgent { $botArray = [ 'Scooter', 'Spinne', 'Vagabondo', 'Firefly', 'Scrubby', 'NG', 'Pompos', 'Szukacz', 'Schmozilla', '42_HAL', 'NetResearchServer', 'LinkWalker', 'Zeus', 'W3C_Validator', 'ZyBorg', 'Ask Jeeves', 'ia_archiver', - 'PingALink Monitoring Services', 'IlTrovatore-Setaccio', 'Nutch', 'Mercator', 'search.ch', - 'appie', 'larbin', 'NutchCVS', 'Webchat', 'Mediapartners-Google', 'sitecheck.internetseer.com', - 'FavOrg', 'findlinks', 'DataCha0s', 'ichiro', 'Francis', 'CoralWebPrx', 'DoCoMo', 'Ocelli', 'Sogou Video', - 'Yandex', 'Yeti', 'Austronaut-URL-Checker' + 'PingALink Monitoring Services', 'IlTrovatore-Setaccio', 'Nutch', 'Mercator', 'search.ch', 'appie', 'larbin', + 'NutchCVS', 'Webchat', 'Mediapartners-Google', 'sitecheck.internetseer.com', 'FavOrg', 'findlinks', 'DataCha0s', + 'ichiro', 'Francis', 'CoralWebPrx', 'DoCoMo', 'Ocelli', 'Sogou Video', 'Yandex', 'Yeti', + 'Austronaut-URL-Checker', 'check_ssl_cert', 'check_http', 'vdirsyncer', 'Feedbin feed-id', + 'Cloudflare Custom Hostname Verification', 'FreshRSS', 'UniversalFeedParser', ]; if (in_array($this->brand, $botArray)) { -- 2.35.3 From 19aad8afcc770848fd356bd5f8c2d8286c6e97a3 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 8 Jan 2023 16:51:01 +0100 Subject: [PATCH 5/9] update bot detection with a few more UA names --- classes/useragent.php-class | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/useragent.php-class b/classes/useragent.php-class index 6aea289..00ceb3a 100755 --- a/classes/useragent.php-class +++ b/classes/useragent.php-class @@ -982,12 +982,12 @@ class userAgent { $botArray = [ 'Scooter', 'Spinne', 'Vagabondo', 'Firefly', 'Scrubby', 'NG', 'Pompos', 'Szukacz', 'Schmozilla', '42_HAL', - 'NetResearchServer', 'LinkWalker', 'Zeus', 'W3C_Validator', 'ZyBorg', 'Ask Jeeves', 'ia_archiver', + 'NetResearchServer', 'LinkWalker', 'Zeus', 'W3C_Validator', 'ZyBorg', 'Ask Jeeves', 'ia_archiver', 'ichiro', 'PingALink Monitoring Services', 'IlTrovatore-Setaccio', 'Nutch', 'Mercator', 'search.ch', 'appie', 'larbin', 'NutchCVS', 'Webchat', 'Mediapartners-Google', 'sitecheck.internetseer.com', 'FavOrg', 'findlinks', 'DataCha0s', - 'ichiro', 'Francis', 'CoralWebPrx', 'DoCoMo', 'Ocelli', 'Sogou Video', 'Yandex', 'Yeti', - 'Austronaut-URL-Checker', 'check_ssl_cert', 'check_http', 'vdirsyncer', 'Feedbin feed-id', - 'Cloudflare Custom Hostname Verification', 'FreshRSS', 'UniversalFeedParser', + 'Francis', 'CoralWebPrx', 'DoCoMo', 'Ocelli', 'Sogou Video', 'Yandex', 'Yeti', 'SEO Scanner', 'Feedbin feed-id', + 'Austronaut-URL-Checker', 'check_ssl_cert', 'check_http', 'vdirsyncer', 'FreshRSS', 'UniversalFeedParser', + 'Cloudflare Custom Hostname Verification', 'Scoop.it', ]; if (in_array($this->brand, $botArray)) { -- 2.35.3 From c79be4c2c1230110175194a8aee78a5eb20d6af0 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 26 Feb 2023 02:41:20 +0100 Subject: [PATCH 6/9] add support for datalist element --- classes/document.php-class | 39 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/classes/document.php-class b/classes/document.php-class index ed688b6..4490589 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -125,6 +125,10 @@ class ExtendedDocument extends DOMDocument { // appends an ExtendedDocument::createElementLabel() as a child of this document (see there for params) // returns the new child // + // public function appendElementDatalist([$id], [$options]) + // appends an ExtendedDocument::createElementDatalist() as a child of this document (see there for params) + // returns the new child + // // public function appendText($text) // appends a DOMDocument::createTextNode() as a child of this document (see there for params) // returns the new child @@ -250,6 +254,9 @@ class ExtendedDocument extends DOMDocument { // public function createElementLabel($for_id, $value) // returns an ExtendedElement that is an HTML