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:
authorMorris Jobke <hey@morrisjobke.de>2016-09-14 12:28:42 +0300
committerGitHub <noreply@github.com>2016-09-14 12:28:42 +0300
commit56124372568cccba5f5febfeaf9931b14f24b36f (patch)
tree8f0b6734406429aef5890232ff5ad2391658c4a1
parent32c77bd48eacc2bee1c230fe838f99d09eed7558 (diff)
parentbb19180e9e9f4454b1e45b13ad453f56c8851fe8 (diff)
Merge pull request #10 from nextcloud/fix-unlink
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);