diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-12-24 02:42:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 02:42:15 +0300 |
commit | ddfa42e16f6648a1f54d2912fcc897e0ae07b75e (patch) | |
tree | 946ba5d504f97c941d691a6f9ce625df742c94f1 /core/CronArchive.php | |
parent | c9ce54d30ef1abd915bf6c069d577e4052575bd3 (diff) |
Better fix for climulti segment encoding bug (#17004)
* Segment should not be double encoded when async climulti is unsupported.
* better fix for original bug, make sure request command sets query_string since it is used to get the segment
* remove use
* Use curl requests for core:archive in test.
* fix test
Diffstat (limited to 'core/CronArchive.php')
-rw-r--r-- | core/CronArchive.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index da8236b355..57e6ea259d 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -212,6 +212,11 @@ class CronArchive private $cliMultiRequestParser; /** + * @var bool|mixed + */ + private $supportsAsync; + + /** * Constructor. * * @param string|null $processNewSegmentsFrom When to archive new segments from. See [General] process_new_segments_from @@ -235,7 +240,8 @@ class CronArchive $this->rawLogDao = new RawLogDao(); - $this->cliMultiRequestParser = new RequestParser($this->makeCliMulti()->supportsAsync()); + $this->supportsAsync = $this->makeCliMulti()->supportsAsync(); + $this->cliMultiRequestParser = new RequestParser($this->supportsAsync); $this->archiveFilter = new ArchiveFilter(); } @@ -654,7 +660,7 @@ class CronArchive { $request = "?module=API&method=CoreAdminHome.archiveReports&idSite=$idSite&period=$period&date=" . $date . "&format=json"; if ($segment) { - $request .= '&segment=' . urlencode(urlencode($segment)); + $request .= '&segment=' . urlencode($segment); } if (!empty($plugin)) { $request .= "&plugin=" . $plugin; @@ -696,7 +702,7 @@ class CronArchive if (empty($response)) { $message .= "The response was empty. This usually means a server error. A solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. "; - if($this->makeCliMulti()->supportsAsync()) { + if($this->supportsAsync) { $message .= " For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log"; } else { $message .= " For more information and the error message please check your web server's error Log file. As this core:archive command triggers PHP processes over HTTP, you can find the error message in your Matomo's web server error logs. "; |