From 38c563dcdcfc46742a55be3b9b84a37512e203d3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 9 Oct 2013 20:34:18 +0200 Subject: don't trigger the create hooks when if the file already exists for file_put_contents --- lib/private/files/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/files/view.php b/lib/private/files/view.php index aa08a5f7cc9..f74b595c8da 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -324,7 +324,8 @@ class View { return false; } } else { - return $this->basicOperation('file_put_contents', $path, array('create', 'write'), $data); + $hooks = ($this->file_exists($path)) ? array('write') : array('create', 'write'); + return $this->basicOperation('file_put_contents', $path, $hooks, $data); } } -- cgit v1.2.3