From 953a7ac711c1f56d6919c9a94b980ae14f7de0df Mon Sep 17 00:00:00 2001 From: sullrich Date: Sat, 12 Dec 2009 00:05:18 -0500 Subject: Test to see if is_url() exists --- config/squidGuard/squidguard_configurator.inc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'config/squidGuard') diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc index 81177b52..dcbb28f4 100644 --- a/config/squidGuard/squidguard_configurator.inc +++ b/config/squidGuard/squidguard_configurator.inc @@ -1758,15 +1758,17 @@ function sg_list_itemsfield($xml_items, $fld_name) # ------------------------------------------------------------------------------ # is_url - check url an err_codes # ------------------------------------------------------------------------------ -function is_url($url) -{ - if (empty($url)) return false; - if (eregi("^http://", $url)) return true; - if (eregi("^https://", $url)) return true; - if (strstr("blank", $url)) return true; - if (strstr("blank_img", $url)) return true; - if (eregi("^((30[1235]{1})|(40[0-9]{1})|(41[0-7]{1})|(50[0-5]{1}))", $url)) return true; # http error code 30x, 4xx, 50x. - return false; +if(!function_exists("is_url")) { + function is_url($url) + { + if (empty($url)) return false; + if (eregi("^http://", $url)) return true; + if (eregi("^https://", $url)) return true; + if (strstr("blank", $url)) return true; + if (strstr("blank_img", $url)) return true; + if (eregi("^((30[1235]{1})|(40[0-9]{1})|(41[0-7]{1})|(50[0-5]{1}))", $url)) return true; # http error code 30x, 4xx, 50x. + return false; + } } # url as 'domain/path': 'mydomain.com/index.php' -- cgit v1.2.3