/*
* Code to strip any {JFBCxyz} tags from head. Caused issues on some users sites in 4.3.1
* Removing until more error-proof method found.
//Get the head
$content = JResponse::getBody();
$regex = '|<head(.*)?</head>|sui';
preg_match($regex, $content, $matches);
//Remove the tag if it's in the head
$newHead = preg_replace('|{'.$tag.'(.*?)}|ui', '', $matches[0]);
//Replace the head
$content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content);
JResponse::setBody($content);
*//*
* Code to strip any {JFBCxyz} tags from head. Caused issues on some user's sites in 4.3.1
* Removing until more error-proof method found.
*/
//Get the head
$content = JResponse::getBody();
$regex = '|<head(.*)?</head>|sui';
if (preg_match($regex, $content, $matches))
{
if (count($matches) == 2) // more than one head is a problem, don't do anything
{
//Remove the tag if it's in the head
$newHead = preg_replace('|{' . $tag . '(.*?)}|ui', '', $matches[0], -1, $count);
if ($count > 0)
{
//Replace the head
$content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content, -1, $count);
if ($count == 1) // Only update the body if exactly one head was found and replaced
JResponse::setBody($content);
}
}
}Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.
