minitemplator: fix deprecations for PHP 7.4
This commit is contained in:
parent
1f2a721905
commit
491090d21b
|
@ -309,7 +309,7 @@ function processTemplateCommand ($cmdL, $cmdTPosBegin, $cmdTPosEnd, &$resumeFrom
|
||||||
$resumeFromStart = true;
|
$resumeFromStart = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
|
if ($cmd[0] == '$' && !(strlen($cmd) >= 2 && $cmd[1] == '{')) {
|
||||||
$this->triggerError ("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
|
$this->triggerError ("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
|
||||||
return false; }}
|
return false; }}
|
||||||
return true; }
|
return true; }
|
||||||
|
@ -856,10 +856,10 @@ function readFileIntoString ($fileName, &$s) {
|
||||||
*/
|
*/
|
||||||
function parseWord ($s, &$p, &$w) {
|
function parseWord ($s, &$p, &$w) {
|
||||||
$sLen = strlen($s);
|
$sLen = strlen($s);
|
||||||
while ($p < $sLen && ord($s{$p}) <= 32) $p++;
|
while ($p < $sLen && ord($s[$p]) <= 32) $p++;
|
||||||
if ($p >= $sLen) return false;
|
if ($p >= $sLen) return false;
|
||||||
$p0 = $p;
|
$p0 = $p;
|
||||||
while ($p < $sLen && ord($s{$p}) > 32) $p++;
|
while ($p < $sLen && ord($s[$p]) > 32) $p++;
|
||||||
$w = substr($s, $p0, $p - $p0);
|
$w = substr($s, $p0, $p - $p0);
|
||||||
return true; }
|
return true; }
|
||||||
|
|
||||||
|
@ -869,11 +869,11 @@ function parseWord ($s, &$p, &$w) {
|
||||||
*/
|
*/
|
||||||
function parseQuotedString ($s, &$p, &$w) {
|
function parseQuotedString ($s, &$p, &$w) {
|
||||||
$sLen = strlen($s);
|
$sLen = strlen($s);
|
||||||
while ($p < $sLen && ord($s{$p}) <= 32) $p++;
|
while ($p < $sLen && ord($s[$p]) <= 32) $p++;
|
||||||
if ($p >= $sLen) return false;
|
if ($p >= $sLen) return false;
|
||||||
if (substr($s,$p,1) != '"') return false;
|
if (substr($s,$p,1) != '"') return false;
|
||||||
$p++; $p0 = $p;
|
$p++; $p0 = $p;
|
||||||
while ($p < $sLen && $s{$p} != '"') $p++;
|
while ($p < $sLen && $s[$p] != '"') $p++;
|
||||||
if ($p >= $sLen) return false;
|
if ($p >= $sLen) return false;
|
||||||
$w = substr($s, $p0, $p - $p0);
|
$w = substr($s, $p0, $p - $p0);
|
||||||
$p++;
|
$p++;
|
||||||
|
@ -885,7 +885,7 @@ function parseQuotedString ($s, &$p, &$w) {
|
||||||
*/
|
*/
|
||||||
function parseWordOrQuotedString ($s, &$p, &$w) {
|
function parseWordOrQuotedString ($s, &$p, &$w) {
|
||||||
$sLen = strlen($s);
|
$sLen = strlen($s);
|
||||||
while ($p < $sLen && ord($s{$p}) <= 32) $p++;
|
while ($p < $sLen && ord($s[$p]) <= 32) $p++;
|
||||||
if ($p >= $sLen) return false;
|
if ($p >= $sLen) return false;
|
||||||
if (substr($s,$p,1) == '"')
|
if (substr($s,$p,1) == '"')
|
||||||
return $this->parseQuotedString($s,$p,$w);
|
return $this->parseQuotedString($s,$p,$w);
|
||||||
|
|
Loading…
Reference in New Issue