Stop accessng _tpl_vars in smarty from property
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 23 Sep 2023 02:02:50 +0000 (14:02 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 23 Sep 2023 02:02:50 +0000 (14:02 +1200)
it's bad practice & it hard fails in smartyv3

CRM/Core/Smarty/plugins/function.help.php

index 754d2ec401ed247da3790626732aef7cbf58b3f6..8ceeebaa9f756b0a631c66765c7fcb0215945182 100644 (file)
  *   the help html to be inserted
  */
 function smarty_function_help($params, &$smarty) {
-  if (!isset($params['id']) || !isset($smarty->_tpl_vars['config'])) {
+  if (!isset($params['id']) || !isset($smarty->get_template_vars()['config'])) {
     return NULL;
   }
 
-  if (empty($params['file']) && isset($smarty->_tpl_vars['tplFile'])) {
-    $params['file'] = $smarty->_tpl_vars['tplFile'];
+  if (empty($params['file']) && isset($smarty->get_template_vars()['tplFile'])) {
+    $params['file'] = $smarty->get_template_vars()['tplFile'];
   }
   elseif (empty($params['file'])) {
     return NULL;