diff --git a/check.php b/check.php index 1e06188..64012f3 100644 --- a/check.php +++ b/check.php @@ -1,13 +1,5 @@ null,"Dropbox" => null,"AmazonWebServices" => null); @@ -19,43 +11,3 @@ $services[$service] = $adapter->check($formid,$qid); } exit(json_encode($services)); -function injection($str) { - $bad = array( - '', - "'", '"', - '<', '>', - '&', '$', - '=', - ';', - '?', - '/', - '!', - '#', - '%20', //space - '%22', // " - '%3c', // < - '%253c', // < - '%3e', // > - '%0e', // > - '%28', // ( - '%29', // ) - '%2528', // ( - '%26', // & - '%24', // $ - '%3f', // ? - '%3b', // ; - '%3d', // = - '%2F', // / - '%2E', // . - // '46', // . - // '47' // / - ); - do - { - $old = $str; - $str = str_replace($bad, ' ', $str); - } - while ($old !== $str); - return $str; -} - diff --git a/database.php b/database.php index 72ea00e..7a05f9b 100644 --- a/database.php +++ b/database.php @@ -1,14 +1,6 @@ injection($post["formid"]),"folder"=>injection($post["folder"]),"qid" => injection($post["qid"]), "key" => $post["key"], "file" => injection($post["file"]),"folderKey" => injection($post["folderKey"]))); return $adapter->upload($params); } diff --git a/gearman/workers/amazonWorker.php b/gearman/workers/amazonWorker.php index 28deba0..ff91cb7 100644 --- a/gearman/workers/amazonWorker.php +++ b/gearman/workers/amazonWorker.php @@ -1,9 +1,5 @@ addServer("127.0.0.1", "4730"); diff --git a/gearman/workers/driveWorker.php b/gearman/workers/driveWorker.php index 99330fa..ff60ba4 100644 --- a/gearman/workers/driveWorker.php +++ b/gearman/workers/driveWorker.php @@ -1,10 +1,5 @@ addServer("127.0.0.1", "4730"); diff --git a/gearman/workers/dropboxWorker.php b/gearman/workers/dropboxWorker.php index 62c442c..3d68455 100644 --- a/gearman/workers/dropboxWorker.php +++ b/gearman/workers/dropboxWorker.php @@ -1,9 +1,4 @@ addServer("127.0.0.1", "4730"); $worker->addFunction("toprakDBX", "toprakDbxUpload"); diff --git a/includes.php b/includes.php index c7c52e3..f638458 100644 --- a/includes.php +++ b/includes.php @@ -3,6 +3,19 @@ require_once(__DIR__.DIRECTORY_SEPARATOR."src".DIRECTORY_SEPARATOR."XUP".DIRECTORY_SEPARATOR."adapters".DIRECTORY_SEPARATOR."drive.php"); require_once(__DIR__.DIRECTORY_SEPARATOR."src".DIRECTORY_SEPARATOR."XUP".DIRECTORY_SEPARATOR."adapters".DIRECTORY_SEPARATOR."dropbox.php"); require_once(__DIR__.DIRECTORY_SEPARATOR."src".DIRECTORY_SEPARATOR."XUP".DIRECTORY_SEPARATOR."adapters".DIRECTORY_SEPARATOR."amazonwebservices.php"); +require_once(DIRECTORY_SEPARATOR."www".DIRECTORY_SEPARATOR."v3".DIRECTORY_SEPARATOR."toprak".DIRECTORY_SEPARATOR."Adapter". DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php"); + +use Aws\S3\S3Client; +use XUP\Uploader\Main; +use XUP\Uploader\Drive; +use XUP\Uploader\Dropbox; +use Spatie\Dropbox\Client; +use League\Flysystem\Filesystem; +use XUP\Uploader\AmazonWebServices; +use Aws\Common\Credentials\Credentials; +use Spatie\FlysystemDropbox\DropboxAdapter; + + function injection($str) { $bad = array( '', @@ -71,7 +84,7 @@ function type($str){ } return true; } - + function mime($str){ $neverAllow = array( "application/octet-stream",