summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-07-16 20:14:26 +0000
committerDries Buytaert <dries@buytaert.net>2003-07-16 20:14:26 +0000
commit8759ca7368fbe6014286b320cf25185fc1e1a602 (patch)
tree866d91c2a873e06d7ef8bc2af5afeb9d60c5235f /includes
parent1252d51264e9cc45062fe60c2a6b5d6ccf18b8cc (diff)
downloadbrdo-8759ca7368fbe6014286b320cf25185fc1e1a602.tar.gz
brdo-8759ca7368fbe6014286b320cf25185fc1e1a602.tar.bz2
- Commited the URL aliasing patch. Thanks Matt.
This update requires you to run update.php!
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 145cb07a8..e846f8640 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -299,6 +299,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:
*
* @param $item a single search result as returned by <module>_search of type