summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax/removeRootCertificate.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/ajax/removeRootCertificate.php')
-rw-r--r--apps/files_external/ajax/removeRootCertificate.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_external/ajax/removeRootCertificate.php b/apps/files_external/ajax/removeRootCertificate.php
index 8c196eddf55..6871b0fd1d4 100644
--- a/apps/files_external/ajax/removeRootCertificate.php
+++ b/apps/files_external/ajax/removeRootCertificate.php
@@ -5,7 +5,10 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$view = \OCP\Files::getStorage("files_external");
-$cert = ltrim($_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();
+}
+