From a80842fbc26b8633472eae1b22093e5b56bb114d Mon Sep 17 00:00:00 2001 From: Victor Boctor Date: Wed, 10 Jan 2018 18:18:45 -0800 Subject: [PATCH] Throw exception when upload folder is not valid --- core/file_api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/file_api.php b/core/file_api.php index ab608b5130..3fbeb85b1a 100644 --- a/core/file_api.php +++ b/core/file_api.php @@ -951,7 +951,9 @@ function file_allow_bug_upload( $p_bug_id = null, $p_user_id = null ) { */ function file_ensure_valid_upload_path( $p_upload_path ) { if( !file_exists( $p_upload_path ) || !is_dir( $p_upload_path ) || !is_writable( $p_upload_path ) || !is_readable( $p_upload_path ) ) { - trigger_error( ERROR_FILE_INVALID_UPLOAD_PATH, ERROR ); + throw new ServiceException( + 'Upload folder not valid', + ERROR_FILE_INVALID_UPLOAD_PATH ); } }