vendor/Zend: Avoid curly braces to access array offsets
https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.array-string-access-curly-brace
This commit is contained in:
parent
67dd439673
commit
0a44bbc804
|
@ -227,7 +227,7 @@ class Zend_Filter_Compress_Zip extends Zend_Filter_Compress_CompressAbstract
|
|||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||
$statIndex = $zip->statIndex($i);
|
||||
$currName = $statIndex['name'];
|
||||
if (($currName{0} == '/') ||
|
||||
if (($currName[0] == '/') ||
|
||||
(substr($currName, 0, 2) == '..') ||
|
||||
(substr($currName, 0, 4) == './..')
|
||||
)
|
||||
|
|
|
@ -317,7 +317,7 @@ class Zend_Json_Decoder
|
|||
$i = $this->_offset;
|
||||
$start = $i;
|
||||
|
||||
switch ($str{$i}) {
|
||||
switch ($str[$i]) {
|
||||
case '{':
|
||||
$this->_token = self::LBRACE;
|
||||
break;
|
||||
|
@ -344,14 +344,14 @@ class Zend_Json_Decoder
|
|||
break;
|
||||
}
|
||||
|
||||
$chr = $str{$i};
|
||||
$chr = $str[$i];
|
||||
|
||||
if ($chr == '\\') {
|
||||
$i++;
|
||||
if ($i >= $str_length) {
|
||||
break;
|
||||
}
|
||||
$chr = $str{$i};
|
||||
$chr = $str[$i];
|
||||
switch ($chr) {
|
||||
case '"' :
|
||||
$result .= '"';
|
||||
|
@ -423,7 +423,7 @@ class Zend_Json_Decoder
|
|||
return($this->_token);
|
||||
}
|
||||
|
||||
$chr = $str{$i};
|
||||
$chr = $str[$i];
|
||||
if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {
|
||||
if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s',
|
||||
$str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) {
|
||||
|
@ -483,7 +483,7 @@ class Zend_Json_Decoder
|
|||
$i += 5;
|
||||
break;
|
||||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||
$utf8 .= $chrs{$i};
|
||||
$utf8 .= $chrs[$i];
|
||||
break;
|
||||
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
|
@ -541,7 +541,7 @@ class Zend_Json_Decoder
|
|||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
|
||||
|
||||
switch (true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
|
|
|
@ -556,17 +556,17 @@ class Zend_Json_Encoder
|
|||
case 2:
|
||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x07 & (ord($utf8{0}) >> 2))
|
||||
. chr((0xC0 & (ord($utf8{0}) << 6))
|
||||
| (0x3F & ord($utf8{1})));
|
||||
return chr(0x07 & (ord($utf8[0]) >> 2))
|
||||
. chr((0xC0 & (ord($utf8[0]) << 6))
|
||||
| (0x3F & ord($utf8[1])));
|
||||
|
||||
case 3:
|
||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr((0xF0 & (ord($utf8{0}) << 4))
|
||||
| (0x0F & (ord($utf8{1}) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8{1}) << 6))
|
||||
| (0x7F & ord($utf8{2})));
|
||||
return chr((0xF0 & (ord($utf8[0]) << 4))
|
||||
| (0x0F & (ord($utf8[1]) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8[1]) << 6))
|
||||
| (0x7F & ord($utf8[2])));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
|
|
|
@ -165,7 +165,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract
|
|||
$isbn10 = str_replace($this->_separator, '', $value);
|
||||
$sum = 0;
|
||||
for ($i = 0; $i < 9; $i++) {
|
||||
$sum += (10 - $i) * $isbn10{$i};
|
||||
$sum += (10 - $i) * $isbn10[$i];
|
||||
}
|
||||
|
||||
// checksum
|
||||
|
@ -183,9 +183,9 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract
|
|||
$sum = 0;
|
||||
for ($i = 0; $i < 12; $i++) {
|
||||
if ($i % 2 == 0) {
|
||||
$sum += $isbn13{$i};
|
||||
$sum += $isbn13[$i];
|
||||
} else {
|
||||
$sum += 3 * $isbn13{$i};
|
||||
$sum += 3 * $isbn13[$i];
|
||||
}
|
||||
}
|
||||
// checksum
|
||||
|
|
Loading…
Reference in New Issue