diff --git a/src/Authhtpasswd.php b/src/Authhtpasswd.php index c492ae9..3e5ed43 100644 --- a/src/Authhtpasswd.php +++ b/src/Authhtpasswd.php @@ -44,7 +44,7 @@ class Authhtpasswd extends Auth foreach ($lines as $line) { // Comment line : skip it - if (isset ($line{0}) && $line{0} === "#") + if (isset ($line[0]) && $line[0] === "#") continue; $line = trim ($line); $user = strstr ($line, ":", true); diff --git a/src/Authzgroups.php b/src/Authzgroups.php index 0ecb241..65b3556 100644 --- a/src/Authzgroups.php +++ b/src/Authzgroups.php @@ -167,7 +167,7 @@ class Authzgroups if ($object === null || ! is_string ($object)) throw new \Exception ("Object not provided to authzgroups\\accessRight", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, "$object"); if ($this->debug) @@ -202,7 +202,7 @@ class Authzgroups if ($object === null || ! is_string ($object)) throw new \Exception ("Object not provided to authzgroups\\accessWrite", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, $object); if ($this->debug) @@ -239,7 +239,7 @@ class Authzgroups if ($object === null || ! is_string ($object)) throw new \Exception ("Object not provided to authzgroups\\accessReadOnly", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, $object); if ($this->debug) diff --git a/src/Authzgroupsoo.php b/src/Authzgroupsoo.php index 57474be..e87ad8d 100644 --- a/src/Authzgroupsoo.php +++ b/src/Authzgroupsoo.php @@ -188,7 +188,7 @@ class Authzgroupsoo if ($object === null || ! is_string ($object)) throw new \Exception ("Object not provided to authzgroups\\accessRight", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, "$object"); if ($this->debug) @@ -223,7 +223,7 @@ class Authzgroupsoo if ($object === null || ! is_string ($object)) throw new \Exception ("Object not provided to authzgroups\\accessWrite", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, $object); if ($this->debug) @@ -260,7 +260,7 @@ class Authzgroupsoo if ($object === null || ! is_string ($object)) throw new \Exception ( "Object not provided to authzgroups\\accessReadOnly", 500); - if ($object{0} !== "/") + if ($object[0] !== "/") $object = "/$object"; $rc = $this->allow ($module, $user, $object); if ($this->debug) diff --git a/src/Console.php b/src/Console.php index b578053..761ce21 100644 --- a/src/Console.php +++ b/src/Console.php @@ -496,7 +496,7 @@ class Console $this->moveCursor ($cursorPos); } // }}} - elseif (ord ($char{0}) === 27) + elseif (ord ($char[0]) === 27) { // ESC SEQUENCE $sequence = ""; @@ -1014,9 +1014,9 @@ class Console while ($token) { // find double quoted tokens - if ($token{0}=='"') { $token .= ' '.strtok('"').'"'; } + if ($token[0]=='"') { $token .= ' '.strtok('"').'"'; } // find single quoted tokens - if ($token{0}=="'") { $token .= ' '.strtok("'")."'"; } + if ($token[0]=="'") { $token .= ' '.strtok("'")."'"; } $tokens[] = $token; $token = strtok(' '); } diff --git a/src/Httpclient.php b/src/Httpclient.php index fc32e29..5898d2a 100644 --- a/src/Httpclient.php +++ b/src/Httpclient.php @@ -571,7 +571,7 @@ class Httpclient if ($i > 0) $path .= "&"; $path .= rawurlencode ($key)."="; - if (isset ($val{0}) && $val{0} === "@") + if (isset ($val[0]) && $val[0] === "@") { $file = substr ($val, 1); if (! file_exists ($file)) @@ -624,7 +624,7 @@ class Httpclient if ($len > 0) $len++; // Add the & $len += strlen (rawurlencode ($key)) + 1; - if (isset ($val{0}) && $val{0} === "@") + if (isset ($val[0]) && $val[0] === "@") { $file = substr ($val, 1); if (! file_exists ($file)) @@ -685,7 +685,7 @@ class Httpclient } $this->tcpclient->send (rawurlencode ($key)."="); $this->log (3, rawurlencode ($key)."="); - if (isset ($val{0}) && $val{0} === "@") + if (isset ($val[0]) && $val[0] === "@") { $file = substr ($val, 1); if (! file_exists ($file)) @@ -825,7 +825,7 @@ class Httpclient $location = $this->headersReceived["Location"]; $parseURLInit = parse_url ($url); $parseURLLocation = parse_url ($location); - if ($parseURLLocation["path"]{0} !== "/" && + if ($parseURLLocation["path"][0] !== "/" && key_exists ("path", $parseURLInit)) $location = dirname ($parseURLInit["path"]).$location; if (! key_exists ("port", $parseURLLocation) && @@ -1086,7 +1086,7 @@ class Httpclient return array (); if (! key_exists ("path", $parseURL)) $parseURL["path"] = "/"; - if ($parseURL["path"]{0} !== "/") + if ($parseURL["path"][0] !== "/") $parseURL["path"] = "/".$parseURL["path"]; $res = array (); foreach ($this->cookies as $storedCookie) diff --git a/src/Mail.php b/src/Mail.php index bd69140..a64bf26 100644 --- a/src/Mail.php +++ b/src/Mail.php @@ -374,7 +374,7 @@ class Mail $headersSplit[$i+1] = $headerBodySeparator; if ($h === "" || $h === "--") continue; - if ($h{0} === " " || $h{0} === "\t") + if ($h[0] === " " || $h[0] === "\t") { $prev .= $prevCR.$h; $prevCR = $headersSplit[$i+1]; @@ -952,7 +952,7 @@ class Mail $part = $this->sectionGet ($attachmentIDs[$number]); foreach ($part as $key=>$val) { - if ($key{0} === "_") + if ($key[0] === "_") { if ($key !== "_contentEML" && $key !== "_contentUTF" && $key !== "_parentID" && $key !== "_headersArray" && @@ -1671,7 +1671,7 @@ class Mail $res["Content-Type"] = $key; else { - if ($val{0} === "'" || $val{0} === "\"") + if ($val[0] === "'" || $val[0] === "\"") $val = substr ($val, 1, -1); $res[trim ($key)] = $val; } diff --git a/src/Markdown.php b/src/Markdown.php index 4e8ed93..75b2da2 100644 --- a/src/Markdown.php +++ b/src/Markdown.php @@ -451,7 +451,7 @@ echo "$res\n"; */ private function lineType ($line) { - if (! isset ($line{0})) + if (! isset ($line[0])) return "NONE"; if (preg_match ("/^[ \t]*[+*-] /", $line) === 1) return "ul"; diff --git a/src/Spfcheck.php b/src/Spfcheck.php index 433cb48..35b2ded 100644 --- a/src/Spfcheck.php +++ b/src/Spfcheck.php @@ -114,11 +114,11 @@ class Spfcheck if ($ipaddresses->ipInNetwork ($ip, $ipToTest, $mask)) { $this->matchRule = "$key/$part"; - if ($part{0} === "-") + if ($part[0] === "-") return "FAIL"; - if ($part{0} === "~") + if ($part[0] === "~") return "SOFTFAIL"; - if ($part{0} === "?") + if ($part[0] === "?") return "NEUTRAL"; return "PASS"; } @@ -259,8 +259,8 @@ class Spfcheck $ips[$domain][$part] = array (); // Manage the sign in front of part $sign = ""; - if ($part{0} === "+" || $part{0} === "-" || $part{0} === "~" || - $part{0} === "?") + if ($part[0] === "+" || $part[0] === "-" || $part[0] === "~" || + $part[0] === "?") { $sign = $part[0]; $part = substr ($part, 1);