From 8759ca7368fbe6014286b320cf25185fc1e1a602 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 16 Jul 2003 20:14:26 +0000 Subject: - Commited the URL aliasing patch. Thanks Matt. This update requires you to run update.php! --- includes/common.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 145cb07a8..e846f8640 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -298,6 +298,21 @@ function valid_email_address($mail) { } } +/** + * Verify the syntax of the given URL. + * + * @param $url an URL + */ +function valid_url($url) { + + if (preg_match("/^[a-zA-z0-9\/:_\-_\.]+$/", $url)) { + return 1; + } + else { + return 0; + } +} + /** * Format a single result entry of a search query: * -- cgit v1.2.3