Fix incorrect use of curly braces in legacy classes

This commit is contained in:
Kijin Sung 2020-05-19 20:52:44 +09:00
parent 2cbfd4500c
commit 14ad62e869
4 changed files with 39 additions and 39 deletions

View file

@ -2100,7 +2100,7 @@ class Context
*/
public static function normalizeFilePath($file)
{
if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
if($file[0] != '/' && $file[0] != '.' && strpos($file, '://') === FALSE)
{
$file = './' . $file;
}

View file

@ -631,7 +631,7 @@ class FrontEndFileHandler extends Handler
*/
protected function _normalizeFilePath($path)
{
if(strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.')
if(strpos($path, '://') === FALSE && $path[0] != '/' && $path[0] != '.')
{
$path = './' . $path;
}

View file

@ -484,7 +484,7 @@ class TemplateHandler
// find closing tag
$close_php = '<?php ' . str_repeat('}', $closing) . ' ?>';
// self closing tag
if($node{1} == '!' || substr($node, -2, 1) == '/' || isset($self_closing[$tag]))
if($node[1] == '!' || substr($node, -2, 1) == '/' || isset($self_closing[$tag]))
{
$nodes[$idx + 1] = $close_php . $nodes[$idx + 1];
}
@ -545,7 +545,7 @@ class TemplateHandler
return $m[0];
}
if($m[1]{0} == '@')
if($m[1][0] == '@')
{
$m[1] = self::_replaceVar(substr($m[1], 1));
return "<?php {$m[1]} ?>";
@ -866,7 +866,7 @@ class TemplateHandler
}
if($mm[1])
{
if($mm[1]{0} == 'e')
if($mm[1][0] == 'e')
{
return '<?php } ?>' . $m[9];
}
@ -931,7 +931,7 @@ class TemplateHandler
$_path = $path;
$fileDir = strtr(realpath($this->path), '\\', '/');
if($path{0} != '/')
if($path[0] != '/')
{
$path = strtr(realpath($fileDir . '/' . $path), '\\', '/');
}

View file

@ -279,7 +279,7 @@ class Validator
foreach($this->_filters as $key => $filter)
{
$names = array();
if($key{0} == '^')
if($key[0] == '^')
{
$names = preg_grep('/^' . preg_quote(substr($key, 1)) . '/', $field_names);
}