From 7f7d8d91014294325d63bc9ef41c6b162578d98e Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sun, 15 Mar 2015 15:44:54 -0700 Subject: [PATCH] [ticket/13550] Check that the Plupload temp directory is writable before moving This prevents a PHP warning from being issued that results in an invalid JSON response being returned to the user. PHPBB3-13550 --- phpBB/phpbb/plupload/plupload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 3c686a552f..fcce5b3bd8 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -326,7 +326,7 @@ class plupload $tmp_file = $this->temporary_filepath($upload['tmp_name']); - if (!move_uploaded_file($upload['tmp_name'], $tmp_file)) + if (!phpbb_is_writable($this->temporary_directory) || !move_uploaded_file($upload['tmp_name'], $tmp_file)) { $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED'); }