From 4cee85b6d7d3c81796a83b70ee78ab44fe7b95f7 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Sun, 27 Sep 2009 16:52:11 +0000 Subject: [PATCH] Stricter coding + allow to shortcut ip flood check git-svn-id: http://yourls.googlecode.com/svn/trunk@209 12232710-3e20-11de-b438-597f59cd7555 --- includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index b614373..4a6c467 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1257,6 +1257,12 @@ function yourls_get_duplicate_keywords( $longurl ) { // Check if an IP shortens URL too fast to prevent DB flood. Return true, or die. function yourls_check_IP_flood( $ip = '' ) { + if( + ( defined('YOURLS_FLOOD_DELAY_SECONDS') && YOURLS_FLOOD_DELAY_SECONDS === 0 ) || + !defined('YOURLS_FLOOD_DELAY_SECONDS') + ) + return true; + $ip = ( $ip ? yourls_sanitize_ip( $ip ) : yourls_get_IP() ); // Don't throttle whitelist IPs -- 2.45.0