diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-09-30 23:01:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-30 23:01:30 +0300 |
commit | 0fc4d1d1cc7c18d3fbe7a5594fcfb7b6c57f39aa (patch) | |
tree | ada8d1896d9c6886c4f0b631c6899e6cfcc4617f /core/Http.php | |
parent | 779d992038a912f8d1fd9c0eba042f58c8056bc9 (diff) |
HTTP method needs to return true when a destination path is given (#14921)
In https://github.com/matomo-org/matomo/pull/14877 I added a new feature so plugins can hook into HTTP. Now noticed the GeoIP download was not working because it didn't return true when the response was loaded into a file.
Diffstat (limited to 'core/Http.php')
-rw-r--r-- | core/Http.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/core/Http.php b/core/Http.php index 4525b21365..f7dc89f9de 100644 --- a/core/Http.php +++ b/core/Http.php @@ -244,16 +244,19 @@ class Http * described below * @ignore */ - Piwik::postEvent('Http.sendHttpRequest.end', array($aUrl, $httpEventParams, &$response, &$status, &$headers)); - - if ($getExtendedInfo) { - return array( - 'status' => $status, - 'headers' => $headers, - 'data' => $response - ); + Piwik::postEvent('Http.sendHttpRequest.end', array($aUrl, $httpEventParams, &$response, &$status, &$headers)); + + if ($destinationPath && file_exists($destinationPath)) { + return true; + } + if ($getExtendedInfo) { + return array( + 'status' => $status, + 'headers' => $headers, + 'data' => $response + ); } else { - return trim($response); + return trim($response); } } |