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

View file

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