I am developing a plugin to get rid of any rel="nofollow" on HTML links using a buffer, but its not working. I am testing it with a nofollow link on a Custom HTML Module.
I thought that "JFactory::getApplication()->getBody();" would output me the body content but was I wrong?
The aim is to remove any nofollow on template, modules and component.
Here my code so far:
function onContentAfterDisplay()
{
$buffer = JFactory::getApplication()->getBody();
$buffer = str_ireplace(' rel=”nofollow”', '', $buffer);
$buffer = str_ireplace(' rel=\'nofollow\'', '', $buffer);
JFactory::getApplication()->setBody($buffer);
}