diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-09-13 18:58:30 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-09-13 18:58:30 +0300 |
commit | bb19180e9e9f4454b1e45b13ad453f56c8851fe8 (patch) | |
tree | 8f0b6734406429aef5890232ff5ad2391658c4a1 | |
parent | 32c77bd48eacc2bee1c230fe838f99d09eed7558 (diff) |
Unlink template only if it exists
* fixes nextcloud/server#503
-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); |