-
Notifications
You must be signed in to change notification settings - Fork 0
/
move.php
38 lines (33 loc) · 1.07 KB
/
move.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require("config.inc.php");
$path = isset($_REQUEST["path"])?$_REQUEST["path"]:"";
if($_SERVER["HTTP_HOST"] == __ADMIN_HOST__){
if ($path != ""){
$extension = strrchr($path,".");
switch($extension){
case ".gif":
case ".GIF":
case ".jpg":
case ".JPG":
case ".jpeg":
case ".JPEG":
case ".png":
case ".PNG":
$message += shell_exec("cwebp -q 100 -z 9 -lossless ".__UPLOADS_FULL_PATH__.$path." -o ".__SMALL_PIX_FULL_PATH__.$path.".webp");
shell_exec("cp ".__SMALL_PIX_FULL_PATH__.$path.".webp ".__ORIGINAL_PIX_FULL_PATH__);
shell_exec('rm '.__UPLOADS_FULL_PATH__.$path);
break;
case ".webp":
case ".WEBP":
shell_exec("cp ".__UPLOADS_FULL_PATH__.$path." ".__ORIGINAL_PIX_FULL_PATH__);
shell_exec("cp ".__UPLOADS_FULL_PATH__.$path." ".__SMALL_PIX_FULL_PATH__);
shell_exec("rm ".__UPLOADS_FULL_PATH__.$path);
break;
}
}
else
header($_SERVER['SERVER_PROTOCOL'] . ' 500 No Path', true, 500);
}
else
header($_SERVER['SERVER_PROTOCOL'] . ' 403 Not allowed', true, 403);
?>