From b42685c63ad758edcdce2fadea3ea9bd0dc26405 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 1 Jul 2019 11:15:38 +0200 Subject: [PATCH] Fix errors when reporting errors Signed-off-by: William Desportes --- error_report.php | 2 +- libraries/classes/ErrorReport.php | 2 +- libraries/classes/Utils/HttpRequest.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/error_report.php b/error_report.php index 54de4584e1..3e9c9a6b1c 100644 --- a/error_report.php +++ b/error_report.php @@ -55,7 +55,7 @@ if (isset($_POST['send_error_report']) // report if and only if there were 'actual' errors. if (count($reportData) > 0) { $server_response = $errorReport->send($reportData); - if ($server_response === false) { + if (! is_string($server_response)) { $success = false; } else { $decoded_response = json_decode($server_response, true); diff --git a/libraries/classes/ErrorReport.php b/libraries/classes/ErrorReport.php index 3ae5aab365..d11462a67a 100644 --- a/libraries/classes/ErrorReport.php +++ b/libraries/classes/ErrorReport.php @@ -208,7 +208,7 @@ class ErrorReport * * @param array $report the report info to be sent * - * @return string the reply of the server + * @return string|null|bool the reply of the server */ public function send(array $report) { diff --git a/libraries/classes/Utils/HttpRequest.php b/libraries/classes/Utils/HttpRequest.php index d0727a3a40..37c875a35b 100644 --- a/libraries/classes/Utils/HttpRequest.php +++ b/libraries/classes/Utils/HttpRequest.php @@ -63,7 +63,7 @@ class HttpRequest * @param int $httpStatus HTTP response status code * @param bool $returnOnlyStatus If set to true, the method would only return response status * - * @return mixed + * @return string|null|bool */ private function response( $response, @@ -92,7 +92,7 @@ class HttpRequest * @param string $header Header to be set for the HTTP request * @param int $ssl SSL mode to use * - * @return mixed + * @return string|null|bool */ private function curl( $url, @@ -192,7 +192,7 @@ class HttpRequest * @param mixed $content Content to be sent with HTTP request * @param string $header Header to be set for the HTTP request * - * @return mixed + * @return string|null|bool */ private function fopen( $url, @@ -239,7 +239,7 @@ class HttpRequest * @param mixed $content Content to be sent with HTTP request * @param string $header Header to be set for the HTTP request * - * @return mixed + * @return string|null|bool */ public function create( $url,