]> jfr.im git - uguu.git/commitdiff
Delete core.php
authorEric Johansson (neku) <redacted>
Wed, 11 Feb 2015 17:18:09 +0000 (18:18 +0100)
committerEric Johansson (neku) <redacted>
Wed, 11 Feb 2015 17:18:09 +0000 (18:18 +0100)
core.php [deleted file]

diff --git a/core.php b/core.php
deleted file mode 100644 (file)
index 3be8288..0000000
--- a/core.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-function save_file ($file, $name, $arg){
-    //Where to save
-    $path='/home/neku/www/files/';
-    //Generate name depending on arg
-    switch($arg){
-        case 'random':
-            $ext = pathinfo($file.$name, PATHINFO_EXTENSION);
-            $file_name = gen_name('random', $ext);
-            while(file_exists($path.$file_name)){
-                $file_name = gen_name('random', $ext);
-            }
-            break;
-        case 'custom_original':
-            $name = strip_tags(preg_replace('/\s+/', '', $name));
-            $file_name = gen_name('custom_original', $name);
-            while(file_exists($path.$file_name)){
-                $file_name = gen_name('custom_original', $name);
-            }
-            break;
-    }
-    //Move the file to the above location with said filename
-    move_uploaded_file($file,$path.$file_name);
-    //Return url+filename to the user
-    echo 'http://a.uguu.se/'.$file_name;
-}
-function gen_name($arg, $in){
-    $chars = 'abcdefghijklmnopqrstuvwxyz';
-    $name = '';
-    for ($i = 0; $i < 6; $i++) {
-    $name .= $chars[mt_rand(0, 25)];
-        }
-    switch($arg){
-        case 'random':
-            return $name.'.'.$in;
-            break;
-        case 'custom_original':
-            return $name.'_'.$in;
-            break;
-    }
-}
-?>