Skip to content

Commit

Permalink
curly braces for array index are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Dec 5, 2019
1 parent d17d164 commit dfa9abb
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion wbce/admin/pages/sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
'TEXT_CHANGE_SETTINGS' => $TEXT['CHANGE_SETTINGS'],
'TEXT_NAMESECTION' => $TEXT['SECTION'] . ' ' . $TEXT['NAME'],
'TEXT_PUBL_START_DATE' => $TEXT{'PUBL_START_DATE'},
'TEXT_PUBL_START_DATE' => $TEXT['PUBL_START_DATE'],
'TEXT_PUBL_END_DATE' => $TEXT['PUBL_END_DATE'],
'LAST_MODIFIED' => $MESSAGE['PAGES_LAST_MODIFIED'],
'VAR_PAGE_TITLE' => $aPage['page_title'],
Expand Down
2 changes: 1 addition & 1 deletion wbce/include/captcha/captchas/calc_ttf_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
$y = mt_rand($height - 10, $height - 2);
do {
for ($i = 0; $i < strlen($text); $i++) {
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text{$i});
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text[$i]);
$angle = mt_rand(-10, 10);
$x = mt_rand($res[4], $res[4] + 10);
$y = mt_rand($height - 12, $height - 7);
Expand Down
6 changes: 3 additions & 3 deletions wbce/include/captcha/captchas/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
while ($s = current($content)) {
// get question
$s = trim(rtrim(rtrim($s, "\n"), "\r")); // remove newline
if ($s == '' or $s{0} != '?') {
if ($s == '' or $s[0] != '?') {
next($content);
continue;
}
if (isset($s{3}) && $s{3} == ':') {
if (isset($s[3]) && $s[3] == ':') {
$lang = substr($s, 1, 2);
$q = substr($s, 4);
} else {
Expand All @@ -64,7 +64,7 @@
// get answer
$s = next($content);
$s = trim(rtrim(rtrim($s, "\n"), "\r")); // remove newline
if (isset($s{0}) && $s{0} == '!') {
if (isset($s[0]) && $s[0] == '!') {
$a = substr($s, 1);
$qa[$lang][$q] = $a;
next($content);
Expand Down
2 changes: 1 addition & 1 deletion wbce/include/captcha/captchas/ttf_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function randomString($len)
$y = mt_rand($height - 10, $height - 2);
do {
for ($i = 0; $i < strlen($text); $i++) {
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text{$i});
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text[$i]);
$angle = mt_rand(-15, 15);
$x = mt_rand($res[4], $res[4] + 10);
$y = mt_rand($height - 15, $height - 5);
Expand Down
10 changes: 5 additions & 5 deletions wbce/include/idna_convert/idna_convert.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ protected function _decode($encoded)
$delim_pos = strrpos($encoded, '-');
if ($delim_pos > self::byteLength($this->_punycode_prefix)) {
for ($k = self::byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) {
$decoded[] = ord($encoded{$k});
$decoded[] = ord($encoded[$k]);
}
}
$deco_len = count($decoded);
Expand All @@ -437,7 +437,7 @@ protected function _decode($encoded)

for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) {
$digit = $this->_decode_digit($encoded{$enco_idx++});
$digit = $this->_decode_digit($encoded[$enco_idx++]);
$idx += $digit * $w;
$t = ($k <= $bias) ? $this->_tmin :
(($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
Expand Down Expand Up @@ -864,7 +864,7 @@ protected function _utf8_to_ucs4($input)
$mode = 'next';
$test = 'none';
for ($k = 0; $k < $inp_len; ++$k) {
$v = ord($input{$k}); // Extract byte from input string
$v = ord($input[$k]); // Extract byte from input string
if ($v < 128) { // We found an ASCII char - put into stirng as is
$output[$out_len] = $v;
++$out_len;
Expand Down Expand Up @@ -995,7 +995,7 @@ protected function _ucs4_string_to_ucs4($input)
$out_len++;
$output[$out_len] = 0;
}
$output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
$output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
}
return $output;
}
Expand Down Expand Up @@ -3458,4 +3458,4 @@ public function singleton($params = array())
0x361 => 234, 0x345 => 240
)
);
}
}
6 changes: 3 additions & 3 deletions wbce/include/idna_convert/transcode_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function map_w1252_iso8859_1($string = '')
if ($string == '') return '';
$return = '';
for ($i = 0; $i < strlen($string); ++$i) {
$c = ord($string{$i});
$c = ord($string[$i]);
switch ($c) {
case 129: $return .= chr(252); break;
case 132: $return .= chr(228); break;
Expand All @@ -119,7 +119,7 @@ function map_iso8859_1_w1252($string = '')
if ($string == '') return '';
$return = '';
for ($i = 0; $i < strlen($string); ++$i) {
$c = ord($string{$i});
$c = ord($string[$i]);
switch ($c) {
case 196: $return .= chr(142); break;
case 214: $return .= chr(153); break;
Expand All @@ -134,4 +134,4 @@ function map_iso8859_1_w1252($string = '')
return $return;
}

?>
?>
12 changes: 6 additions & 6 deletions wbce/include/idna_convert/uctc.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static function utf8_ucs4array($input)
$mode = 'next';
$test = 'none';
for ($k = 0; $k < $inp_len; ++$k) {
$v = ord($input{$k}); // Extract byte from input string
$v = ord($input[$k]); // Extract byte from input string

if ($v < 128) { // We found an ASCII char - put into stirng as is
$output[$out_len] = $v;
Expand Down Expand Up @@ -176,7 +176,7 @@ private static function utf7_ucs4array($input, $sc = '+')
$b64 = '';

for ($k = 0; $k < $inp_len; ++$k) {
$c = $input{$k};
$c = $input[$k];
if (0 == ord($c)) continue; // Ignore zero bytes
if ('b' == $mode) {
// Sequence got terminated
Expand All @@ -193,10 +193,10 @@ private static function utf7_ucs4array($input, $sc = '+')
$tmp = substr($tmp, -1 * (strlen($tmp) % 2));
for ($i = 0; $i < strlen($tmp); $i++) {
if ($i % 2) {
$output[$out_len] += ord($tmp{$i});
$output[$out_len] += ord($tmp[$i]);
$out_len++;
} else {
$output[$out_len] = ord($tmp{$i}) << 8;
$output[$out_len] = ord($tmp[$i]) << 8;
}
}
$mode = 'd';
Expand Down Expand Up @@ -292,9 +292,9 @@ private static function ucs4_ucs4array($input)
$out_len++;
$output[$out_len] = 0;
}
$output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
$output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
}
return $output;
}
}
?>
?>
2 changes: 1 addition & 1 deletion wbce/search/search_modext.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function list_files_dirs($dir, $depth = true, $files = array(), $dirs = array())
{
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
if ($file{0} == '.' || $file == '..') {
if ($file[0] == '.' || $file == '..') {
continue;
}
if (is_dir($dir . '/' . $file)) {
Expand Down

0 comments on commit dfa9abb

Please sign in to comment.