From 645a7eb6de6a6b0ecdac1a9edb56fe18ce950829 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Mon, 25 May 2015 17:15:53 +0200 Subject: [PATCH] add methods for password fields --- include/cbsm/util/document.php-class | 36 ++++++++++++++++++++++++++++ include/classes/useragent.php-class | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/cbsm/util/document.php-class b/include/cbsm/util/document.php-class index 257d52b..a10041a 100755 --- a/include/cbsm/util/document.php-class +++ b/include/cbsm/util/document.php-class @@ -62,6 +62,10 @@ class ExtendedDocument extends DOMDocument { // appends an ExtendedDocument::createElementInputText() as a child of this document (see there for params) // returns the new child // + // function appendInputPassword($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputPassword() as a child of this document (see there for params) + // returns the new child + // // function appendInputRadio($name, $id, $value, $checked) // appends an ExtendedDocument::createElementInputRadio() as a child of this document (see there for params) // returns the new child @@ -135,6 +139,10 @@ class ExtendedDocument extends DOMDocument { // returns an ExtendedElement that is an HTML of type 'text' with the given name, maxlength, size, // and optionally id and value // + // function createElementInputPassword($name, $maxlength, $size, [$id], [$value]) + // returns an ExtendedElement that is an HTML of type 'password' with the given name, maxlength, size, + // and optionally id and value + // // function createElementInputRadio($name, $id, $value, $checked) // returns an ExtendedElement that is an HTML of type 'radio' with the given name, id, value and // checked state @@ -203,6 +211,9 @@ class ExtendedDocument extends DOMDocument { function appendInputText($name, $maxlength, $size, $id = null, $value = null) { return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $value)); } + function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) { + return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value)); + } function appendInputRadio($name, $id, $value, $checked) { return $this->appendChild($this->createElementInputRadio($name, $id, $value, $checked)); } @@ -298,6 +309,17 @@ class ExtendedDocument extends DOMDocument { return $txfield; } + function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) { + $txfield = $this->createElement('input'); + $txfield->setAttribute('type', 'password'); + if (!is_null($id)) { $txfield->setAttribute('id', $id); } + $txfield->setAttribute('name', $name); + $txfield->setAttribute('maxlength', $maxlength); + $txfield->setAttribute('size', $size); + if (!is_null($value)) { $txfield->setAttribute('value', $value); } + return $txfield; + } + function createElementInputRadio($name, $id, $value, $checked) { $radio = $this->createElement('input'); $radio->setAttribute('type', 'radio'); @@ -416,6 +438,10 @@ class ExtendedElement extends DOMElement { // appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params) // returns the new child // + // function appendInputPassword($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputPassword() as a child of this element (see there for params) + // returns the new child + // // function appendInputRadio($name, $id, $value, $checked) // appends an ExtendedDocument::createElementInputRadio() as a child of this element (see there for params) // returns the new child @@ -496,6 +522,9 @@ class ExtendedElement extends DOMElement { function appendInputText($name, $maxlength, $size, $id = null, $value = null) { return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value)); } + function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) { + return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value)); + } function appendInputRadio($name, $id, $value, $checked) { return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked)); } @@ -573,6 +602,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { // appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params) // returns the new child // + // function appendInputPassword($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputPassword() as a child of this fragment (see there for params) + // returns the new child + // // function appendInputRadio($name, $id, $value, $checked) // appends an ExtendedDocument::createElementInputRadio() as a child of this fragment (see there for params) // returns the new child @@ -653,6 +686,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { function appendInputText($name, $maxlength, $size, $id = null, $value = null) { return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value)); } + function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) { + return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value)); + } function appendInputRadio($name, $id, $value, $checked) { return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked)); } diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index 09415a7..a70915d 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -1234,7 +1234,7 @@ class userAgent { $this->uadata['eng_version'] = null; } } - elseif ($this->hasEngine('edge')) { + elseif ($this->hasEngine('edgehtml')) { if (preg_match('#Mozilla/5.0 \(([^;]+); (WOW64|Win64); ([^\);]+)\)#', $this->uastring, $regs)) { $this->uadata['os'] = $regs[1].' ('.$regs[2].')'; } -- 2.43.0