Raptor
06-27-2019, 08:05 PM
Hello, all.
I'm attempting to replace a string in the footer template, and I'm running into an issue.
$z_name = 'footer';
if (isset($vbulletin->templatecache[$z_name]))
{
$z_temp = $vbulletin->templatecache[$z_name];
$str_search = "injected_data";
$str_replace = "fubar_123";
// This works:
$z_temp = str_replace($str_search, $str_replace, $z_temp);
// This doesn't:
$vbulletin->templatecache[$z_name] = $z_temp;
}
$z_temp is getting set - if I echo out the contents, I get the correct content (the footer template contents with the replaced string). However, setting the templatecache at the end is not working: it is not set to the contents of $z_temp, and appears to be unchanged.
Any help would be appreciated!
I'm attempting to replace a string in the footer template, and I'm running into an issue.
$z_name = 'footer';
if (isset($vbulletin->templatecache[$z_name]))
{
$z_temp = $vbulletin->templatecache[$z_name];
$str_search = "injected_data";
$str_replace = "fubar_123";
// This works:
$z_temp = str_replace($str_search, $str_replace, $z_temp);
// This doesn't:
$vbulletin->templatecache[$z_name] = $z_temp;
}
$z_temp is getting set - if I echo out the contents, I get the correct content (the footer template contents with the replaced string). However, setting the templatecache at the end is not working: it is not set to the contents of $z_temp, and appears to be unchanged.
Any help would be appreciated!