When "EnableContextLinks" was disabled, the "IPAddressResolve" setting was ignored.

The check order in AddContextLinks has been fixed now in order to solve the problem.
This commit is contained in:
Andre Lorbach 2011-09-13 11:39:08 +02:00
parent 92da351766
commit cedddbf053

View File

@ -1350,10 +1350,6 @@ function AddContextLinks(&$sourceTxt)
{ {
global $szTLDDomains; global $szTLDDomains;
// check if user disabled Context Links.
if ( GetConfigSetting("EnableContextLinks", 1, CFGLEVEL_USER) == 0 )
return;
// Return if not enabled! // Return if not enabled!
if ( GetConfigSetting("EnableIPAddressResolve", 0, CFGLEVEL_USER) == 1 ) if ( GetConfigSetting("EnableIPAddressResolve", 0, CFGLEVEL_USER) == 1 )
{ {
@ -1361,6 +1357,10 @@ function AddContextLinks(&$sourceTxt)
$sourceTxt = preg_replace( '/([^\[])\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/ie', "'\\1\\2.\\3.\\4.\\5' . ReverseResolveIP('\\2.\\3.\\4.\\5', '<font class=\"highlighted\"> {', '} </font>')", $sourceTxt ); $sourceTxt = preg_replace( '/([^\[])\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/ie', "'\\1\\2.\\3.\\4.\\5' . ReverseResolveIP('\\2.\\3.\\4.\\5', '<font class=\"highlighted\"> {', '} </font>')", $sourceTxt );
} }
// check if user disabled Context Links.
if ( GetConfigSetting("EnableContextLinks", 1, CFGLEVEL_USER) == 0 )
return;
// Create if not set! // Create if not set!
if ( !isset($szTLDDomains) ) if ( !isset($szTLDDomains) )
CreateTopLevelDomainSearch(); CreateTopLevelDomainSearch();