summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-12 17:21:06 +0100
committerHorus32014-03-12 17:21:06 +0100
commit9a63d1abed608ecce689fa4e7409c498c8d827ff (patch)
tree2e1fe2a989850b9ed0733447f2ec2eb488ac6005
parent9c3bb2457b1d05cb0c044260cfaaaad2a9935b96 (diff)
downloadfiles.iamfabulous.de-9a63d1abed608ecce689fa4e7409c498c8d827ff.tar.gz
regex for detecting hyperlinks
-rw-r--r--www/upload.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/www/upload.php b/www/upload.php
index ed25d85..5c3f758 100644
--- a/www/upload.php
+++ b/www/upload.php
@@ -110,4 +110,12 @@ function upload($db){
}
}
+function web_upload($db){
+ $url = ;
+ if(preg_match("/^((https?|ftp)?://|www\.|ftp\.)?([-a-z0-9+&@#/%?=~_|!:,.;]+\.)+[a-z]{2}[a-z]*/i", $url)){
+ echo "hyperlink detected";
+ } else {
+ echo "no hyperlink";
+ }
+}
upload($db);