Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/templateeditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-14 13:22:07 +0300
committerGitHub <noreply@github.com>2016-09-14 13:22:07 +0300
commit8e0c01ec11567440afd1bd226ecab7f79e47a0d6 (patch)
treee9449e13138214d48ee175f4ac296a070f6b2de7
parentbf78f930a9f86c167545a2c6da52aaa9c2a2047b (diff)
parent2ca8645dd6e41b9183dfb086d54d005c39a2ad50 (diff)
[stable10] Unlink template only if it exists
-rw-r--r--lib/mailtemplate.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mailtemplate.php b/lib/mailtemplate.php
index c1c1b84..285aa83 100644
--- a/lib/mailtemplate.php
+++ b/lib/mailtemplate.php
@@ -124,8 +124,10 @@ class MailTemplate extends \OC_Template {
if (rename($absolutePath.'.bak', $absolutePath)) {
return true;
}
- } else if (unlink($absolutePath)) {
- return true;
+ } else if(file_exists($absolutePath)) {
+ if (unlink($absolutePath)) {
+ return true;
+ }
}
}
return !file_exists($absolutePath);