summaryrefslogtreecommitdiff
path: root/www/upload.php
diff options
context:
space:
mode:
authorroot2014-03-12 19:40:22 +0100
committerroot2014-03-12 19:40:22 +0100
commit3e38a85eb59872496eb5d80f2a971f444bc2c97d (patch)
treeb805af163a815bacb96f63bfebce53aa8f365b60 /www/upload.php
parentf0a3315c79da986224a00429431ae3e5c78c9c33 (diff)
parent246cd8a39c64c174171784fb891a6aca8e3c7dc4 (diff)
downloadfiles.iamfabulous.de-3e38a85eb59872496eb5d80f2a971f444bc2c97d.tar.gz
Respects your privacy now
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);