diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-14 13:22:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 13:22:07 +0300 |
commit | 8e0c01ec11567440afd1bd226ecab7f79e47a0d6 (patch) | |
tree | e9449e13138214d48ee175f4ac296a070f6b2de7 | |
parent | bf78f930a9f86c167545a2c6da52aaa9c2a2047b (diff) | |
parent | 2ca8645dd6e41b9183dfb086d54d005c39a2ad50 (diff) |
Merge pull request #11 from nextcloud/stable10-backport-10v10.0.6RC1v10.0.6v10.0.5RC2v10.0.5RC1v10.0.5v10.0.4RC1v10.0.4v10.0.3RC1v10.0.3v10.0.2v10.0.1RC1v10.0.1stable10
[stable10] 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); |