summaryrefslogtreecommitdiff
path: root/www/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/upload.php')
-rw-r--r--www/upload.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/www/upload.php b/www/upload.php
index ed25d85..2858e72 100644
--- a/www/upload.php
+++ b/www/upload.php
@@ -67,7 +67,8 @@ function upload($db){
$filehash = hash_file("md5", $_FILES['userfile']['tmp_name']);
$hashtest_db = $db->query("SELECT hash FROM files WHERE hash='" . $filehash ."';");
- if(empty($hashtest_db)){
+ $hashtest_ar = $hashtest_ar->fetchArray(SQLITE3_NUM);
+ if(empty($hashtest_ar)){
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])){
@@ -110,4 +111,12 @@ function upload($db){
}
}
+function web_upload($db){ // no use atm
+ $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);