config->load(); $configUrls = $this->config->get('urls_results_batch', '[]'); $configUrls = json_decode($configUrls, true); $decodedResult = $testService->decodeResult($result); if ($decodedResult === null) { DebugService::logMessage('callback_controller.log', 'Error decoding the received data for '.$testId); // We received the results but couldn't decode them, this means that the content may have been truncated by the server in $_POST // We can let the client's server call our API to get the results instead, which has less risk of having this issue if (!empty($configUrls[$testId])) { $configUrls[$testId]['last_check'] = 0; $this->config->save(['urls_results_batch' => json_encode($configUrls)]); } exit; } if (!empty($configUrls[$testId])) { unset($configUrls[$testId]); $this->config->save(['urls_results_batch' => json_encode($configUrls)]); } $testService->handleBatchResults($testId, $decodedResult); exit; } }