Index: trunk/core/kernel/utility/debugger.php =================================================================== diff -u -N -r8064 -r8078 --- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8064) +++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8078) @@ -80,14 +80,7 @@ } // check IP before enabling debug mode - $ip_match = false; - $ip_addresses = isset($dbg_options['DBG_IP']) ? explode(';', $dbg_options['DBG_IP']) : Array (); - foreach ($ip_addresses as $ip_address) { - if ($this->netMatch($ip_address, $_SERVER['REMOTE_ADDR'])) { - $ip_match = true; - break; - } - } + $ip_match = $this->ipMatch(isset($dbg_options['DBG_IP']) ? $dbg_options['DBG_IP'] : ''); if (!$ip_match) { define('DEBUG_MODE', 0); @@ -107,6 +100,28 @@ } /** + * Checks, that user IP address is within allowed range + * + * @param string $ip_list semi-column (by default) separated ip address list + * @param string $separator ip address separator (default ";") + * + * @return bool + */ + function ipMatch($ip_list, $separator = ';') + { + $ip_match = false; + $ip_addresses = $ip_list ? explode($separator, $ip_list) : Array (); + foreach ($ip_addresses as $ip_address) { + if ($this->netMatch($ip_address, $_SERVER['REMOTE_ADDR'])) { + $ip_match = true; + break; + } + } + + return $ip_match; + } + + /** * Set's default values to constants debugger uses * */