From d715c3834168e2dec9a0bd5602aeb9d4dd4f252e Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 23 Jan 2010 12:48:43 +0000 Subject: [PATCH] disable captchas when debugging from localhost --- core/util.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/util.inc.php b/core/util.inc.php index 11b9ad20..e5774191 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -219,6 +219,9 @@ function theme_file($filepath) { function captcha_get_html() { global $config, $user; + + if(DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) return ""; + $captcha = ""; if($user->is_anonymous()) { $rpk = $config->get_string("api_recaptcha_pubkey"); @@ -239,6 +242,8 @@ function captcha_get_html() { function captcha_check() { global $config, $user; + if(DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) return true; + if($user->is_anonymous()) { $rpk = $config->get_string('api_recaptcha_privkey'); if(!empty($rpk)) {