Skip to content

Commit

Permalink
[PHP74] RemovedCurlyBraceArrayAccess in core/plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
nkissebe committed Jun 3, 2021
1 parent 54e3736 commit 77136aa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/plugins/antispam/babajispam/Detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function detect($data)

foreach ($baba as $b)
{
if ((($b{0} == '/') && preg_match($b, $context))
if ((($b[0] == '/') && preg_match($b, $context))
|| (($b[0] != '/') && strpos($context, $b) !== false))
{
$spam += 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function check_signature($request, $consumer, $token, $signature)
$result = 0;
for ($i = 0; $i < strlen($signature); $i++)
{
$result |= ord($built{$i}) ^ ord($signature{$i});
$result |= ord($built[$i]) ^ ord($signature[$i]);
}

return $result == 0;
Expand Down
8 changes: 4 additions & 4 deletions core/plugins/captcha/image/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private function _createImageAdv()
$this->keystring = '';
for ($i=0; $i<$length; $i++)
{
$this->keystring .= $allowed_symbols{mt_rand(0, strlen($allowed_symbols)-1)};
$this->keystring .= $allowed_symbols[mt_rand(0, strlen($allowed_symbols)-1)];
}
if (!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/', $this->keystring))
{
Expand All @@ -217,14 +217,14 @@ private function _createImageAdv()

if (!$reading_symbol && !$transparent)
{
$font_metrics[$alphabet{$symbol}] = array('start'=>$i);
$font_metrics[$alphabet[$symbol]] = array('start'=>$i);
$reading_symbol = true;
continue;
}

if ($reading_symbol && $transparent)
{
$font_metrics[$alphabet{$symbol}]['end'] = $i;
$font_metrics[$alphabet[$symbol]]['end'] = $i;
$reading_symbol = false;
$symbol++;
continue;
Expand All @@ -242,7 +242,7 @@ private function _createImageAdv()
$x = 1;
for ($i=0; $i<$length; $i++)
{
$m = $font_metrics[$this->keystring{$i}];
$m = $font_metrics[$this->keystring[$i]];

$y = mt_rand(-$fluctuation_amplitude, $fluctuation_amplitude)+($height-$fontfile_height)/2+2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function getChangeExtent($fromLine, $toLine)
{
$start = 0;
$limit = min(strlen($fromLine), strlen($toLine));
while ($start < $limit && $fromLine{$start} == $toLine{$start})
while ($start < $limit && $fromLine[$start] == $toLine[$start])
{
++$start;
}
Expand Down
8 changes: 4 additions & 4 deletions core/plugins/support/captcha/captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private function _createImageAdv()
$this->keystring = '';
for ($i=0; $i<$length; $i++)
{
$this->keystring .= $allowed_symbols{mt_rand(0, strlen($allowed_symbols)-1)};
$this->keystring .= $allowed_symbols[mt_rand(0, strlen($allowed_symbols)-1)];
}
if (!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/', $this->keystring))
{
Expand All @@ -521,14 +521,14 @@ private function _createImageAdv()

if (!$reading_symbol && !$transparent)
{
$font_metrics[$alphabet{$symbol}] = array('start'=>$i);
$font_metrics[$alphabet[$symbol]] = array('start'=>$i);
$reading_symbol = true;
continue;
}

if ($reading_symbol && $transparent)
{
$font_metrics[$alphabet{$symbol}]['end'] = $i;
$font_metrics[$alphabet[$symbol]]['end'] = $i;
$reading_symbol = false;
$symbol++;
continue;
Expand All @@ -546,7 +546,7 @@ private function _createImageAdv()
$x = 1;
for ($i=0; $i<$length; $i++)
{
$m = $font_metrics[$this->keystring{$i}];
$m = $font_metrics[$this->keystring[$i]];

$y = mt_rand(-$fluctuation_amplitude, $fluctuation_amplitude)+($height-$fontfile_height)/2+2;

Expand Down
4 changes: 2 additions & 2 deletions core/plugins/wiki/parserdefault/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ private function _getCommon($st1, $st2)

for ($i = 0; $i < $shorter; ++$i)
{
if ($st1{$i} != $st2{$i})
if ($st1[$i] != $st2[$i])
{
break;
}
Expand Down Expand Up @@ -2748,7 +2748,7 @@ private function blocks($text, $linestart=0)
}
else if (!$inBlockElem && !$this->mInPre)
{
if (isset($t{0}) && ' ' == $t{0} and ($this->mLastSection == 'pre' or trim($t) != ''))
if (isset($t[0]) && ' ' == $t[0] and ($this->mLastSection == 'pre' or trim($t) != ''))
{
// pre
if ($this->mLastSection != 'pre')
Expand Down

0 comments on commit 77136aa

Please sign in to comment.