* @copyright PayPal
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Smarty modifier to replace HTML tags in translations.
* @usage {{l='test'}|paypalreplace}
* @param.value string
* @param.name string
*/
if (!function_exists('smarty_modifier_paypalreplace')) {
function smarty_modifier_paypalreplace($string, $replaces = array())
{
$search = array(
'[b]',
'[/b]',
'[br]',
'[em]',
'[/em]',
'[a @href1@]',
'[a @href2@]',
'[/a]',
'[small]',
'[/small]',
'[strong]',
'[/strong]',
'[i]',
'[/i]'
);
$replace = array(
'',
'',
'
',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
''
);
$string = str_replace($search, $replace, $string);
foreach ($replaces as $k => $v) {
$string = str_replace($k, $v, $string);
}
$string = str_replace(' @target@', '', $string);
return $string;
}
}