diff options
| author | Horus3 | 2014-03-12 19:32:07 +0100 |
|---|---|---|
| committer | Horus3 | 2014-03-12 19:32:07 +0100 |
| commit | 11f7f219b72c909cdbf74426e5095d9ee3ef8ec8 (patch) | |
| tree | bd40b8407a63724cea45076aa161fb617dabe09d /www/upload.php | |
| parent | 9a63d1abed608ecce689fa4e7409c498c8d827ff (diff) | |
| download | files.iamfabulous.de-11f7f219b72c909cdbf74426e5095d9ee3ef8ec8.tar.gz | |
fixed PHP's bug with empty()
Diffstat (limited to 'www/upload.php')
| -rw-r--r-- | www/upload.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/www/upload.php b/www/upload.php index 5c3f758..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,7 +111,7 @@ function upload($db){ } } -function web_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"; |
