Cleaning up

Simplify add and edit content. Bugs fixes and improvements.
This commit is contained in:
Danang Probo Sayekti 2015-12-01 18:43:02 +07:00
commit e3e393a7bd
27 changed files with 1898 additions and 3252 deletions

View file

@ -22,8 +22,7 @@ $path = null;
if (login()) {
if (is_dir($dir)) {
} else {
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
}
@ -39,7 +38,7 @@ if (login()) {
if($check !== false) {
if ($error === UPLOAD_ERR_OK) {
$extension = pathinfo($name, PATHINFO_EXTENSION);
if (!in_array($extension, $whitelist)) {
if (!in_array(strtolower($extension), $whitelist)) {
$error = 'Invalid file type uploaded.';
} else {
move_uploaded_file($tmp_name, $dir . $timestamp . '-' . $name);