[Fusionforge-commits] r9439 - trunk/gforge/common/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Apr 8 23:05:41 CEST 2010


Author: aljeux
Date: 2010-04-08 23:05:41 +0200 (Thu, 08 Apr 2010)
New Revision: 9439

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

Modified: trunk/gforge/common/include/utils.php
===================================================================
--- trunk/gforge/common/include/utils.php	2010-04-08 20:39:26 UTC (rev 9438)
+++ trunk/gforge/common/include/utils.php	2010-04-08 21:05:41 UTC (rev 9439)
@@ -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 Fusionforge-commits mailing list