[evolvis-commits] r14793: Add missing util_check_url() used by extratabs plugin

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 04:52:16 CET 2011


Author: mirabilos
Date: 2011-02-28 04:52:15 +0100 (Mon, 28 Feb 2011)
New Revision: 14793

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
Log:
Add missing util_check_url() used by extratabs plugin

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php	2011-02-28 03:52:12 UTC (rev 14792)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php	2011-02-28 03:52:15 UTC (rev 14793)
@@ -103,6 +103,19 @@
 }
 
 /**
+ * util_check_url() - determines if given URL is valid.
+ *
+ * Currently, test is very basic, only the protocol is
+ * checked, allowed values are: http, https, ftp.
+ *
+ * @param		string  The URL
+ * @return		boolean	true if valid, false if not valid.
+ */
+function util_check_url($url) {
+	return (preg_match('/^(http|https|ftp):\/\//', $url) > 0);
+}
+
+/**
  * util_send_message() - Send email
  * This function should be used in place of the PHP mail() function
  *



More information about the evolvis-commits mailing list