Skip to content
Extraits de code Groupes Projets
Valider 54ce7af6 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #5144 better fix for array to string to conversion.

Noticed this hack while I worked on the tracker refactoring. Dispatch
should always return a string. Fixing the problem where it actually occurs.
An even better fix would be not to support serialize=0 for format PHP as
it is meant only for internal requests. If someone wants to access data
serialize=1 should be set.
parent 8fe1e92d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -35,9 +35,7 @@ if (PIWIK_ENABLE_DISPATCH) { ...@@ -35,9 +35,7 @@ if (PIWIK_ENABLE_DISPATCH) {
$controller->init(); $controller->init();
$response = $controller->dispatch(); $response = $controller->dispatch();
if (is_array($response)) { if (!is_null($response)) {
var_export($response);
} elseif (!is_null($response)) {
echo $response; echo $response;
} }
} catch (Exception $ex) { } catch (Exception $ex) {
......
...@@ -30,7 +30,13 @@ class Controller extends \Piwik\Plugin\Controller ...@@ -30,7 +30,13 @@ class Controller extends \Piwik\Plugin\Controller
} }
$request = new Request('token_auth=' . Common::getRequestVar('token_auth', 'anonymous', 'string')); $request = new Request('token_auth=' . Common::getRequestVar('token_auth', 'anonymous', 'string'));
return $request->process(); $response = $request->process();
if (is_array($response)) {
$response = var_export($response, true);
}
return $response;
} }
public function listAllMethods() public function listAllMethods()
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter