diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-09-14 12:28:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 12:28:42 +0300 |
commit | 56124372568cccba5f5febfeaf9931b14f24b36f (patch) | |
tree | 8f0b6734406429aef5890232ff5ad2391658c4a1 | |
parent | 32c77bd48eacc2bee1c230fe838f99d09eed7558 (diff) | |
parent | bb19180e9e9f4454b1e45b13ad453f56c8851fe8 (diff) |
Merge pull request #10 from nextcloud/fix-unlink
Unlink template only if it exists
-rw-r--r-- | lib/mailtemplate.php | 6 |
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); |