Improve issue with certain ?? ternary in 159ed4ee02

for smarty class magic __get() method.
This commit is contained in:
Ian
2022-09-15 12:15:37 +02:00
parent fc06d246bf
commit 0d4939e135

View File

@@ -66,7 +66,7 @@ class Smarty_Internal_Extension_Handler
public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)
{
/* @var Smarty $data ->smarty */
$smarty = $data->smarty ?? $data;
$smarty = isset($data->smarty) ? $data->smarty : $data; // don't use ?? for isset here since that would need a follow-up property define in Smarty class for __get()
if (!isset($smarty->ext->$name)) {
if (preg_match('/^((set|get)|(.*?))([A-Z].*)$/', $name, $match)) {
$basename = $this->upperCase($match[ 4 ]);