Skip to content

Commit 89421ab

Browse files
committed
Fix array and string offset access using curly braces (deprecated since PHP 7.4)
1 parent 1d8ba1d commit 89421ab

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/i18n/sfDateFormat.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
229229
for ($i = 0, $max = count($tokens); $i < $max; $i++)
230230
{
231231
$pattern = $tokens[$i];
232-
if ($pattern{0} == "'" && $pattern{strlen($pattern) - 1} == "'")
232+
if ($pattern[0] == "'" && $pattern{strlen($pattern) - 1} == "'")
233233
{
234234
$tokens[$i] = str_replace('``````', '\'', preg_replace('/(^\')|(\'$)/', '', $pattern));
235235
}
@@ -266,9 +266,9 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
266266
*/
267267
protected function getFunctionName($token)
268268
{
269-
if (isset($this->tokens[$token{0}]))
269+
if (isset($this->tokens[$token[0]]))
270270
{
271-
return $this->tokens[$token{0}];
271+
return $this->tokens[$token[0]];
272272
}
273273
}
274274

lib/util/sfFinder.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,10 @@ protected function exec_ok($dir, $entry)
580580

581581
public static function isPathAbsolute($path)
582582
{
583-
if ($path{0} === '/' || $path{0} === '\\' ||
584-
(strlen($path) > 3 && ctype_alpha($path{0}) &&
585-
$path{1} === ':' &&
586-
($path{2} === '\\' || $path{2} === '/')
583+
if ($path[0] === '/' || $path[0] === '\\' ||
584+
(strlen($path) > 3 && ctype_alpha($path[0]) &&
585+
$path[1] === ':' &&
586+
($path[2] === '\\' || $path[2] === '/')
587587
)
588588
)
589589
{

0 commit comments

Comments
 (0)