Update rm.php

This commit is contained in:
tianyu 2015-08-09 10:08:36 +08:00
parent 799a01c8b1
commit a2e38e9f0a
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
<?php
# I recommend you use HTTPS and Basic access authentication to protect this file.
$locale = 'en_US.utf-8';
setlocale(LC_ALL, $locale);
putenv('LC_ALL='.$locale);
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case 'POST':
@ -9,7 +13,7 @@
echo json_encode($files, JSON_UNESCAPED_SLASHES);
#shell_exec("echo '".json_encode($files)."' >>/tmp/out.txt 2>&1 &");
foreach ($files as $file) {
shell_exec("cd /home/downloads;rm ./'".$file."' >>/tmp/rm.txt 2>&1 &");
shell_exec("cd /home/downloads;rm -- ".escapeshellarg($file)." >>/tmp/rm.txt 2>&1 &");
}
exit;
} else {