Skip to content

Commit

Permalink
Merge pull request #27581 from eileenmcnaughton/smarty_small
Browse files Browse the repository at this point in the history
dev/core##4146 Remove unused variables from custom smarty functions
  • Loading branch information
seamuslee001 committed Sep 27, 2023
2 parents 5e41bf9 + 490b216 commit 2e93a3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions CRM/Core/Smarty/plugins/prefilter.htxtFilter.php
Expand Up @@ -6,10 +6,9 @@
* evaluate unassigned variables.
*
* @param string $tpl_source
* @param $smarty
* @return string
*/
function smarty_prefilter_htxtFilter($tpl_source, &$smarty) {
function smarty_prefilter_htxtFilter($tpl_source) {
if (strpos($tpl_source, '{htxt') === FALSE) {
return $tpl_source;
}
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/Smarty/plugins/prefilter.resetExtScope.php
Expand Up @@ -3,11 +3,11 @@
/**
* Wrap every Smarty template in a {crmScope} tag that sets the
* variable "extensionKey" to blank.
* @param $tpl_source
* @param $smarty
* @param string $tpl_source
*
* @return string
*/
function smarty_prefilter_resetExtScope($tpl_source, &$smarty) {
function smarty_prefilter_resetExtScope($tpl_source) {
return '{crmScope extensionKey=""}'
. $tpl_source
. '{/crmScope}';
Expand Down
15 changes: 4 additions & 11 deletions CRM/Core/Smarty/resources/String.php
Expand Up @@ -15,42 +15,35 @@
* @copyright CiviCRM LLC https://civicrm.org/licensing
* @param $tpl_name
* @param $tpl_source
* @param $smarty_obj
*
* @return bool
*/
function civicrm_smarty_resource_string_get_template($tpl_name, &$tpl_source, &$smarty_obj) {
function civicrm_smarty_resource_string_get_template($tpl_name, &$tpl_source) {
$tpl_source = $tpl_name;
return TRUE;
}

/**
* @param string $tpl_name
* @param $tpl_timestamp
* @param CRM_Core_Smarty $smarty_obj
*
* @return bool
*/
function civicrm_smarty_resource_string_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj) {
function civicrm_smarty_resource_string_get_timestamp($tpl_name, &$tpl_timestamp) {
$tpl_timestamp = time();
return TRUE;
}

/**
* @param string $tpl_name
* @param CRM_Core_Smarty $smarty_obj
*
* @return bool
*/
function civicrm_smarty_resource_string_get_secure($tpl_name, &$smarty_obj) {
function civicrm_smarty_resource_string_get_secure() {
return TRUE;
}

/**
* @param string $tpl_name
* @param CRM_Core_Smarty $smarty_obj
*/
function civicrm_smarty_resource_string_get_trusted($tpl_name, &$smarty_obj) {
function civicrm_smarty_resource_string_get_trusted() {

}

Expand Down

0 comments on commit 2e93a3a

Please sign in to comment.