take '\' on windows systems into account to prevent file deletion above upload direectory

This commit is contained in:
Björn Schießle 2012-09-26 23:08:40 +02:00
parent 9ab887fed5
commit 21c6cc45e6
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck(); OCP\JSON::callCheck();
$view = \OCP\Files::getStorage("files_external"); $view = \OCP\Files::getStorage("files_external");
$cert = ltrim($_POST['cert'], "/."); $cert = ltrim($_POST['cert'], "/\\.");
$file = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/'.$cert; $file = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/'.$cert;
unlink($file); unlink($file);
OC_Mount_Config::createCertificateBundle(); OC_Mount_Config::createCertificateBundle();