Since this thread was made in 2012. The coding has changed a bit.
Can you tell me if i am correct to delete all of this? I tested it and it seems to work fine. Just wanted to double check i am not deleting anything good.
This is what i deleted (in the red):
/**
* Gets the class and target to apply to a specified link URL.
* @param string $url
*
* @return array [class, target, type (internal/external), scheme match]
*/
public static function getLinkClassTarget($url)
{
$target = '_blank';
$class = 'externalLink';
$type = 'external';
$schemeMatch = true;
$urlInfo = @parse_url($url);
if ($urlInfo)
{
if (empty($urlInfo['host']))
{
$isInternal = true;
}
else
{
$host = $urlInfo['host'] . (!empty($urlInfo['port']) ? ":$urlInfo[port]" : '');
$isInternal = ($host == XenForo_Application::$host && strpos($url, 'proxy.php') === false);
$scheme = (!empty($urlInfo['scheme']) ? strtolower($urlInfo['scheme']) : 'http');
$schemeMatch = $scheme == (XenForo_Application::$secure ? 'https' : 'http');
}
if ($isInternal)
{
$target = '';
$class = 'internalLink';
$type = 'internal';
}
}
return array($class, $target, $type, $schemeMatch);
}