diff options
Diffstat (limited to 'apps/files_external/ajax/removeRootCertificate.php')
-rw-r--r-- | apps/files_external/ajax/removeRootCertificate.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_external/ajax/removeRootCertificate.php b/apps/files_external/ajax/removeRootCertificate.php index 9b78e180d9e..664b3937e97 100644 --- a/apps/files_external/ajax/removeRootCertificate.php +++ b/apps/files_external/ajax/removeRootCertificate.php @@ -5,7 +5,9 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); $view = \OCP\Files::getStorage("files_external"); -$cert = $_POST['cert']; -$file = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/'.$cert; -unlink($file); -OC_Mount_Config::createCertificateBundle(); +$file = 'uploads/'.ltrim($_POST['cert'], "/\\."); + +if ( $view->file_exists($file) ) { + $view->unlink($file); + OC_Mount_Config::createCertificateBundle(); +} |