PHP Deprecated: Array and string offset access syntax with curly braces is deprecated
This commit is contained in:
@@ -44,7 +44,7 @@ class Authhtpasswd extends Auth
|
|||||||
foreach ($lines as $line)
|
foreach ($lines as $line)
|
||||||
{
|
{
|
||||||
// Comment line : skip it
|
// Comment line : skip it
|
||||||
if (isset ($line{0}) && $line{0} === "#")
|
if (isset ($line[0]) && $line[0] === "#")
|
||||||
continue;
|
continue;
|
||||||
$line = trim ($line);
|
$line = trim ($line);
|
||||||
$user = strstr ($line, ":", true);
|
$user = strstr ($line, ":", true);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class Authzgroups
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception ("Object not provided to authzgroups\\accessRight",
|
throw new \Exception ("Object not provided to authzgroups\\accessRight",
|
||||||
500);
|
500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, "$object");
|
$rc = $this->allow ($module, $user, "$object");
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
@@ -202,7 +202,7 @@ class Authzgroups
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception ("Object not provided to authzgroups\\accessWrite",
|
throw new \Exception ("Object not provided to authzgroups\\accessWrite",
|
||||||
500);
|
500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, $object);
|
$rc = $this->allow ($module, $user, $object);
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
@@ -239,7 +239,7 @@ class Authzgroups
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception ("Object not provided to authzgroups\\accessReadOnly",
|
throw new \Exception ("Object not provided to authzgroups\\accessReadOnly",
|
||||||
500);
|
500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, $object);
|
$rc = $this->allow ($module, $user, $object);
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class Authzgroupsoo
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception ("Object not provided to authzgroups\\accessRight",
|
throw new \Exception ("Object not provided to authzgroups\\accessRight",
|
||||||
500);
|
500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, "$object");
|
$rc = $this->allow ($module, $user, "$object");
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
@@ -223,7 +223,7 @@ class Authzgroupsoo
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception ("Object not provided to authzgroups\\accessWrite",
|
throw new \Exception ("Object not provided to authzgroups\\accessWrite",
|
||||||
500);
|
500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, $object);
|
$rc = $this->allow ($module, $user, $object);
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
@@ -260,7 +260,7 @@ class Authzgroupsoo
|
|||||||
if ($object === null || ! is_string ($object))
|
if ($object === null || ! is_string ($object))
|
||||||
throw new \Exception (
|
throw new \Exception (
|
||||||
"Object not provided to authzgroups\\accessReadOnly", 500);
|
"Object not provided to authzgroups\\accessReadOnly", 500);
|
||||||
if ($object{0} !== "/")
|
if ($object[0] !== "/")
|
||||||
$object = "/$object";
|
$object = "/$object";
|
||||||
$rc = $this->allow ($module, $user, $object);
|
$rc = $this->allow ($module, $user, $object);
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ class Console
|
|||||||
$this->moveCursor ($cursorPos);
|
$this->moveCursor ($cursorPos);
|
||||||
}
|
}
|
||||||
// }}}
|
// }}}
|
||||||
elseif (ord ($char{0}) === 27)
|
elseif (ord ($char[0]) === 27)
|
||||||
{
|
{
|
||||||
// ESC SEQUENCE
|
// ESC SEQUENCE
|
||||||
$sequence = "";
|
$sequence = "";
|
||||||
@@ -1014,9 +1014,9 @@ class Console
|
|||||||
while ($token)
|
while ($token)
|
||||||
{
|
{
|
||||||
// find double quoted tokens
|
// find double quoted tokens
|
||||||
if ($token{0}=='"') { $token .= ' '.strtok('"').'"'; }
|
if ($token[0]=='"') { $token .= ' '.strtok('"').'"'; }
|
||||||
// find single quoted tokens
|
// find single quoted tokens
|
||||||
if ($token{0}=="'") { $token .= ' '.strtok("'")."'"; }
|
if ($token[0]=="'") { $token .= ' '.strtok("'")."'"; }
|
||||||
$tokens[] = $token;
|
$tokens[] = $token;
|
||||||
$token = strtok(' ');
|
$token = strtok(' ');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -571,7 +571,7 @@ class Httpclient
|
|||||||
if ($i > 0)
|
if ($i > 0)
|
||||||
$path .= "&";
|
$path .= "&";
|
||||||
$path .= rawurlencode ($key)."=";
|
$path .= rawurlencode ($key)."=";
|
||||||
if (isset ($val{0}) && $val{0} === "@")
|
if (isset ($val[0]) && $val[0] === "@")
|
||||||
{
|
{
|
||||||
$file = substr ($val, 1);
|
$file = substr ($val, 1);
|
||||||
if (! file_exists ($file))
|
if (! file_exists ($file))
|
||||||
@@ -624,7 +624,7 @@ class Httpclient
|
|||||||
if ($len > 0)
|
if ($len > 0)
|
||||||
$len++; // Add the &
|
$len++; // Add the &
|
||||||
$len += strlen (rawurlencode ($key)) + 1;
|
$len += strlen (rawurlencode ($key)) + 1;
|
||||||
if (isset ($val{0}) && $val{0} === "@")
|
if (isset ($val[0]) && $val[0] === "@")
|
||||||
{
|
{
|
||||||
$file = substr ($val, 1);
|
$file = substr ($val, 1);
|
||||||
if (! file_exists ($file))
|
if (! file_exists ($file))
|
||||||
@@ -685,7 +685,7 @@ class Httpclient
|
|||||||
}
|
}
|
||||||
$this->tcpclient->send (rawurlencode ($key)."=");
|
$this->tcpclient->send (rawurlencode ($key)."=");
|
||||||
$this->log (3, rawurlencode ($key)."=");
|
$this->log (3, rawurlencode ($key)."=");
|
||||||
if (isset ($val{0}) && $val{0} === "@")
|
if (isset ($val[0]) && $val[0] === "@")
|
||||||
{
|
{
|
||||||
$file = substr ($val, 1);
|
$file = substr ($val, 1);
|
||||||
if (! file_exists ($file))
|
if (! file_exists ($file))
|
||||||
@@ -825,7 +825,7 @@ class Httpclient
|
|||||||
$location = $this->headersReceived["Location"];
|
$location = $this->headersReceived["Location"];
|
||||||
$parseURLInit = parse_url ($url);
|
$parseURLInit = parse_url ($url);
|
||||||
$parseURLLocation = parse_url ($location);
|
$parseURLLocation = parse_url ($location);
|
||||||
if ($parseURLLocation["path"]{0} !== "/" &&
|
if ($parseURLLocation["path"][0] !== "/" &&
|
||||||
key_exists ("path", $parseURLInit))
|
key_exists ("path", $parseURLInit))
|
||||||
$location = dirname ($parseURLInit["path"]).$location;
|
$location = dirname ($parseURLInit["path"]).$location;
|
||||||
if (! key_exists ("port", $parseURLLocation) &&
|
if (! key_exists ("port", $parseURLLocation) &&
|
||||||
@@ -1086,7 +1086,7 @@ class Httpclient
|
|||||||
return array ();
|
return array ();
|
||||||
if (! key_exists ("path", $parseURL))
|
if (! key_exists ("path", $parseURL))
|
||||||
$parseURL["path"] = "/";
|
$parseURL["path"] = "/";
|
||||||
if ($parseURL["path"]{0} !== "/")
|
if ($parseURL["path"][0] !== "/")
|
||||||
$parseURL["path"] = "/".$parseURL["path"];
|
$parseURL["path"] = "/".$parseURL["path"];
|
||||||
$res = array ();
|
$res = array ();
|
||||||
foreach ($this->cookies as $storedCookie)
|
foreach ($this->cookies as $storedCookie)
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ class Mail
|
|||||||
$headersSplit[$i+1] = $headerBodySeparator;
|
$headersSplit[$i+1] = $headerBodySeparator;
|
||||||
if ($h === "" || $h === "--")
|
if ($h === "" || $h === "--")
|
||||||
continue;
|
continue;
|
||||||
if ($h{0} === " " || $h{0} === "\t")
|
if ($h[0] === " " || $h[0] === "\t")
|
||||||
{
|
{
|
||||||
$prev .= $prevCR.$h;
|
$prev .= $prevCR.$h;
|
||||||
$prevCR = $headersSplit[$i+1];
|
$prevCR = $headersSplit[$i+1];
|
||||||
@@ -952,7 +952,7 @@ class Mail
|
|||||||
$part = $this->sectionGet ($attachmentIDs[$number]);
|
$part = $this->sectionGet ($attachmentIDs[$number]);
|
||||||
foreach ($part as $key=>$val)
|
foreach ($part as $key=>$val)
|
||||||
{
|
{
|
||||||
if ($key{0} === "_")
|
if ($key[0] === "_")
|
||||||
{
|
{
|
||||||
if ($key !== "_contentEML" && $key !== "_contentUTF" &&
|
if ($key !== "_contentEML" && $key !== "_contentUTF" &&
|
||||||
$key !== "_parentID" && $key !== "_headersArray" &&
|
$key !== "_parentID" && $key !== "_headersArray" &&
|
||||||
@@ -1671,7 +1671,7 @@ class Mail
|
|||||||
$res["Content-Type"] = $key;
|
$res["Content-Type"] = $key;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($val{0} === "'" || $val{0} === "\"")
|
if ($val[0] === "'" || $val[0] === "\"")
|
||||||
$val = substr ($val, 1, -1);
|
$val = substr ($val, 1, -1);
|
||||||
$res[trim ($key)] = $val;
|
$res[trim ($key)] = $val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ echo "$res\n";
|
|||||||
*/
|
*/
|
||||||
private function lineType ($line)
|
private function lineType ($line)
|
||||||
{
|
{
|
||||||
if (! isset ($line{0}))
|
if (! isset ($line[0]))
|
||||||
return "NONE";
|
return "NONE";
|
||||||
if (preg_match ("/^[ \t]*[+*-] /", $line) === 1)
|
if (preg_match ("/^[ \t]*[+*-] /", $line) === 1)
|
||||||
return "ul";
|
return "ul";
|
||||||
|
|||||||
@@ -114,11 +114,11 @@ class Spfcheck
|
|||||||
if ($ipaddresses->ipInNetwork ($ip, $ipToTest, $mask))
|
if ($ipaddresses->ipInNetwork ($ip, $ipToTest, $mask))
|
||||||
{
|
{
|
||||||
$this->matchRule = "$key/$part";
|
$this->matchRule = "$key/$part";
|
||||||
if ($part{0} === "-")
|
if ($part[0] === "-")
|
||||||
return "FAIL";
|
return "FAIL";
|
||||||
if ($part{0} === "~")
|
if ($part[0] === "~")
|
||||||
return "SOFTFAIL";
|
return "SOFTFAIL";
|
||||||
if ($part{0} === "?")
|
if ($part[0] === "?")
|
||||||
return "NEUTRAL";
|
return "NEUTRAL";
|
||||||
return "PASS";
|
return "PASS";
|
||||||
}
|
}
|
||||||
@@ -259,8 +259,8 @@ class Spfcheck
|
|||||||
$ips[$domain][$part] = array ();
|
$ips[$domain][$part] = array ();
|
||||||
// Manage the sign in front of part
|
// Manage the sign in front of part
|
||||||
$sign = "";
|
$sign = "";
|
||||||
if ($part{0} === "+" || $part{0} === "-" || $part{0} === "~" ||
|
if ($part[0] === "+" || $part[0] === "-" || $part[0] === "~" ||
|
||||||
$part{0} === "?")
|
$part[0] === "?")
|
||||||
{
|
{
|
||||||
$sign = $part[0];
|
$sign = $part[0];
|
||||||
$part = substr ($part, 1);
|
$part = substr ($part, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user