diff --git a/application/core/Files/AsynchronousFileReader.php b/application/core/Files/AsynchronousFileReader.php index bab5a803..c15fb613 100644 --- a/application/core/Files/AsynchronousFileReader.php +++ b/application/core/Files/AsynchronousFileReader.php @@ -46,7 +46,7 @@ class AsynchronousFileReader { fclose($socket->socket); unset($this->sockets[$key]); - $result = array(); + $result = ""; $error = 0; if (time() > ($socket->creationTime + self::SOCKET_TIMEOUT)) { $error = self::TIMEOUT_ERROR; @@ -55,14 +55,15 @@ class AsynchronousFileReader { } else if ($socket->streamBuffer == '') { $error = self::NO_DATA_ERROR; } else { - $result = explode("\r\n\r\n", $socket->streamBuffer, 2); + $resultArray = explode("\r\n\r\n", $socket->streamBuffer, 2); - if (count($result) < 2) { + if (count($resultArray) < 2) { $error = self::INVALID_RESULT_ERROR; + } else { + $result = $resultArray[1]; } } - - call_user_func($socket->function, $result[1], $error); + call_user_func($socket->function, $result, $error); } } } diff --git a/application/core/ManiaExchange/ManiaExchangeManager.php b/application/core/ManiaExchange/ManiaExchangeManager.php index 62849123..30c54baf 100644 --- a/application/core/ManiaExchange/ManiaExchangeManager.php +++ b/application/core/ManiaExchange/ManiaExchangeManager.php @@ -219,7 +219,7 @@ class ManiaExchangeManager { $success = $this->maniaControl->fileReader->loadFile($url, function ($mapInfo, $error) use ($titlePrefix, $url) { if ($error) { - trigger_error($error); + trigger_error($error . " " . $url); return null; }