diff --git a/core.php b/core.php index 0de47165ac..821e5287a0 100644 --- a/core.php +++ b/core.php @@ -82,6 +82,9 @@ die(); } +# Ensure that encoding is always UTF-8 independant from any PHP default or ini setting +mb_internal_encoding('UTF-8'); + ob_start(); # Load Composer autoloader diff --git a/core/commands/IssueNoteAddCommand.php b/core/commands/IssueNoteAddCommand.php index a4734ae90f..4283a88e61 100644 --- a/core/commands/IssueNoteAddCommand.php +++ b/core/commands/IssueNoteAddCommand.php @@ -243,11 +243,7 @@ protected function process() { } # Handle the file upload - if( count( $this->files > 0 ) ) { - $t_file_infos = file_attach_files( $this->issue->id, $this->files ); - } else { - $t_file_infos = array(); - } + $t_file_infos = file_attach_files( $this->issue->id, $this->files ); # We always set the note time to BUGNOTE, and the API will overwrite it with TIME_TRACKING # if time tracking is not 0 and the time tracking feature is enabled. diff --git a/core/file_api.php b/core/file_api.php index 10bd586d50..cc8ada2b65 100644 --- a/core/file_api.php +++ b/core/file_api.php @@ -64,7 +64,7 @@ */ function file_attach_files( $p_bug_id, $p_files ) { if( $p_files === null || count( $p_files ) == 0 ) { - return; + return array(); } $t_file_infos = array();