diff --git a/lib/libraries/TeamSpeak3/Helper/Char.php b/lib/libraries/TeamSpeak3/Helper/Char.php index 1159a1a..c1c04c3 100644 --- a/lib/libraries/TeamSpeak3/Helper/Char.php +++ b/lib/libraries/TeamSpeak3/Helper/Char.php @@ -182,7 +182,7 @@ class TeamSpeak3_Helper_Char */ public function toUnicode() { - $h = ord($this->char{0}); + $h = ord($this->char[0]); if($h <= 0x7F) { @@ -194,15 +194,15 @@ class TeamSpeak3_Helper_Char } else if($h <= 0xDF) { - return ($h & 0x1F) << 6 | (ord($this->char{1}) & 0x3F); + return ($h & 0x1F) << 6 | (ord($this->char[1]) & 0x3F); } else if($h <= 0xEF) { - return ($h & 0x0F) << 12 | (ord($this->char{1}) & 0x3F) << 6 | (ord($this->char{2}) & 0x3F); + return ($h & 0x0F) << 12 | (ord($this->char[1]) & 0x3F) << 6 | (ord($this->char[2]) & 0x3F); } else if($h <= 0xF4) { - return ($h & 0x0F) << 18 | (ord($this->char{1}) & 0x3F) << 12 | (ord($this->char{2}) & 0x3F) << 6 | (ord($this->char{3}) & 0x3F); + return ($h & 0x0F) << 18 | (ord($this->char[1]) & 0x3F) << 12 | (ord($this->char[2]) & 0x3F) << 6 | (ord($this->char[3]) & 0x3F); } else { diff --git a/lib/libraries/TeamSpeak3/Helper/Crypt.php b/lib/libraries/TeamSpeak3/Helper/Crypt.php index ad361fb..a5e71fd 100644 --- a/lib/libraries/TeamSpeak3/Helper/Crypt.php +++ b/lib/libraries/TeamSpeak3/Helper/Crypt.php @@ -175,7 +175,7 @@ class TeamSpeak3_Helper_Crypt $data = 0; for($j = 4; $j > 0; $j--) { - $data = $data << 8 | ord($passphrase{$k}); + $data = $data << 8 | ord($passphrase[$k]); $k = ($k+1) % $length; } $this->p[$i] ^= $data; diff --git a/lib/libraries/TeamSpeak3/Helper/String.php b/lib/libraries/TeamSpeak3/Helper/String.php index 2164b4d..b71f7e4 100644 --- a/lib/libraries/TeamSpeak3/Helper/String.php +++ b/lib/libraries/TeamSpeak3/Helper/String.php @@ -472,7 +472,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable { if(!$this->isUtf8()) { - $this->string = utf8_encode($this->string); + $this->string = mb_convert_encoding($this->string, 'UTF-8', 'ISO-8859-1'); //utf8_encode($this->string); } return $this; @@ -550,7 +550,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable $utf8_accents = array( "à" => "a", "ô" => "o", - "Ä?" => "d", + "�?" => "d", "ḟ" => "f", "ë" => "e", "Å¡" => "s", @@ -560,9 +560,9 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Å™" => "r", "È›" => "t", "ň" => "n", - "Ä?" => "a", + "�?" => "a", "Ä·" => "k", - "Å?" => "s", + "�?" => "s", "ỳ" => "y", "ņ" => "n", "ĺ" => "l", @@ -573,7 +573,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Ä›" => "e", "é" => "e", "ç" => "c", - "áº?" => "w", + "�?" => "w", "Ä‹" => "c", "õ" => "o", "ṡ" => "s", @@ -591,7 +591,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "ŵ" => "w", "ṫ" => "t", "Å«" => "u", - "Ä?" => "c", + "�?" => "c", "ö" => "oe", "è" => "e", "Å·" => "y", @@ -622,7 +622,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "ñ" => "n", "Å„" => "n", "Ä¥" => "h", - "Ä?" => "g", + "�?" => "g", "Ä‘" => "d", "ĵ" => "j", "ÿ" => "y", @@ -639,8 +639,8 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Ä«" => "i", "ã" => "a", "Ä¡" => "g", - "á¹?" => "m", - "Å?" => "o", + "�?" => "m", + "�?" => "o", "Ä©" => "i", "ù" => "u", "į" => "i", @@ -700,7 +700,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "È" => "E", "Ŷ" => "Y", "Ä„" => "A", - "Å?" => "L", + "�?" => "L", "Ų" => "U", "Å®" => "U", "Åž" => "S", @@ -712,12 +712,12 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Ḃ" => "B", "Ã…" => "A", "ÃŒ" => "I", - "Ã?" => "I", + "�?" => "I", "Ḋ" => "D", "Ť" => "T", "Å–" => "R", "Ä" => "Ae", - "Ã?" => "I", + "�?" => "I", "Å”" => "R", "Ê" => "E", "Ü" => "Ue", @@ -727,15 +727,15 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Ń" => "N", "Ĥ" => "H", "Äœ" => "G", - "Ä?" => "D", + "�?" => "D", "Ä´" => "J", "Ÿ" => "Y", "Ũ" => "U", "Ŭ" => "U", "Ư" => "U", "Å¢" => "T", - "Ã?" => "Y", - "Å?" => "O", + "�?" => "Y", + "�?" => "O", "Â" => "A", "Ľ" => "L", "Ẅ" => "W", @@ -749,10 +749,10 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable "Ù" => "U", "Ä®" => "I", "Ź" => "Z", - "Ã?" => "A", + "�?" => "A", "Û" => "U", "Þ" => "Th", - "Ã?" => "Dh", + "�?" => "Dh", "Æ" => "Ae", "Ä”" => "E", "Å’" => "Oe", @@ -856,7 +856,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function count() + public function count(): int { return strlen($this->string); } @@ -864,7 +864,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function rewind() + public function rewind(): void { $this->position = 0; } @@ -872,7 +872,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function valid() + public function valid(): bool { return $this->position < $this->count(); } @@ -880,7 +880,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function key() + public function key(): mixed { return $this->position; } @@ -888,15 +888,15 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function current() + public function current(): mixed { - return new TeamSpeak3_Helper_Char($this->string{$this->position}); + return new TeamSpeak3_Helper_Char($this->string[$this->position]); } /** * @ignore */ - public function next() + public function next(): void { $this->position++; } @@ -904,7 +904,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function offsetExists($offset) + public function offsetExists(mixed $offset) : bool { return ($offset < strlen($this->string)) ? TRUE : FALSE; } @@ -912,25 +912,25 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable /** * @ignore */ - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { - return ($this->offsetExists($offset)) ? new TeamSpeak3_Helper_Char($this->string{$offset}) : null; + return ($this->offsetExists($offset)) ? new TeamSpeak3_Helper_Char($this->string[$offset]) : null; } /** * @ignore */ - public function offsetSet($offset, $value) + public function offsetSet(mixed $offset, mixed $value): void { if(!$this->offsetExists($offset)) return; - $this->string{$offset} = strval($value); + $this->string[$offset] = strval($value); } /** * @ignore */ - public function offsetUnset($offset) + public function offsetUnset(mixed $offset): void { if(!$this->offsetExists($offset)) return; diff --git a/lib/libraries/TeamSpeak3/Node/Abstract.php b/lib/libraries/TeamSpeak3/Node/Abstract.php index b2ab372..573ea3a 100644 --- a/lib/libraries/TeamSpeak3/Node/Abstract.php +++ b/lib/libraries/TeamSpeak3/Node/Abstract.php @@ -473,7 +473,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function count() + public function count(): int { $this->verifyNodeList(); @@ -483,7 +483,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function current() + public function current(): mixed { $this->verifyNodeList(); @@ -493,7 +493,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function getChildren() + public function getChildren(): ?RecursiveIterator { $this->verifyNodeList(); @@ -503,7 +503,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function hasChildren() + public function hasChildren(): bool { $this->verifyNodeList(); @@ -523,7 +523,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function key() + public function key(): mixed { $this->verifyNodeList(); @@ -533,7 +533,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function valid() + public function valid(): bool { $this->verifyNodeList(); @@ -543,27 +543,29 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function next() + public function next(): void { $this->verifyNodeList(); - return next($this->nodeList); + //return next($this->nodeList); + next($this->nodeList); } /** * @ignore */ - public function rewind() + public function rewind(): void { $this->verifyNodeList(); - return reset($this->nodeList); + //return reset($this->nodeList); + reset($this->nodeList); } /** * @ignore */ - public function offsetExists($offset) + public function offsetExists(mixed $offset): bool { return array_key_exists((string) $offset, $this->nodeInfo) ? TRUE : FALSE; } @@ -571,7 +573,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { if(!$this->offsetExists($offset)) { @@ -589,11 +591,12 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function offsetSet($offset, $value) + public function offsetSet(mixed $offset, mixed $value): void { if(method_exists($this, "modify")) { - return $this->modify(array((string) $offset => $value)); + //return $this->modify(array((string) $offset => $value)); + $this->modify(array((string) $offset => $value)); } throw new TeamSpeak3_Node_Exception("node '" . get_class($this) . "' is read only"); @@ -602,7 +605,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces /** * @ignore */ - public function offsetUnset($offset) + public function offsetUnset(mixed $offset): void { unset($this->nodeInfo[(string) $offset]); } diff --git a/lib/libraries/TeamSpeak3/Node/Host.php b/lib/libraries/TeamSpeak3/Node/Host.php index c12f000..90f442d 100644 --- a/lib/libraries/TeamSpeak3/Node/Host.php +++ b/lib/libraries/TeamSpeak3/Node/Host.php @@ -554,7 +554,7 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract $permtree[$val]["permcatid"] = $val; $permtree[$val]["permcathex"] = "0x" . dechex($val); $permtree[$val]["permcatname"] = TeamSpeak3_Helper_String::factory(TeamSpeak3_Helper_Convert::permissionCategory($val)); - $permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"]{3} == 0 ? 0 : hexdec($permtree[$val]["permcathex"]{2} . 0); + $permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"][3] == 0 ? 0 : hexdec($permtree[$val]["permcathex"][2] . 0); $permtree[$val]["permcatchilren"] = 0; $permtree[$val]["permcatcount"] = 0; diff --git a/lib/libraries/TeamSpeak3/Node/Server.php b/lib/libraries/TeamSpeak3/Node/Server.php index 5dae154..fa63bff 100644 --- a/lib/libraries/TeamSpeak3/Node/Server.php +++ b/lib/libraries/TeamSpeak3/Node/Server.php @@ -1976,7 +1976,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract * * @deprecated */ - public function tokenCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1, $id2 = 0, $description = null, $customset = null) + public function tokenCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1 = 0, $id2 = 0, $description = null, $customset = null) { return $this->privilegeKeyCreate($type, $id1, $id2, $description, $customset); } @@ -1991,7 +1991,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract * @param string $customset * @return TeamSpeak3_Helper_String */ - public function privilegeKeyCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1, $id2 = 0, $description = null, $customset = null) + public function privilegeKeyCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1 = 0, $id2 = 0, $description = null, $customset = null) { $token = $this->execute("privilegekeyadd", array("tokentype" => $type, "tokenid1" => $id1, "tokenid2" => $id2, "tokendescription" => $description, "tokencustomset" => $customset))->toList(); @@ -2269,7 +2269,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract { $this->getParent()->serverDelete($this->getId()); - unset($this); + // unset($this); } /** diff --git a/lib_ts3.php b/lib_ts3.php index c6ebe60..04e1f17 100644 --- a/lib_ts3.php +++ b/lib_ts3.php @@ -5,7 +5,6 @@ class lib_ts3 extends \LIB\lib_php{ return self::class;} public static function php_autoload(){ require_once dirname(__FILE__).'/lib/libraries/TeamSpeak3/TeamSpeak3.php'; - //\TeamSpeak3::autoload('abc'); \SYSTEM\autoload::registerFunc('TeamSpeak3::autoload'); return true;} public static function version(){