Una domanda tecnica sul file gpsrenterprise/controllers/front/api.php in PrestaShop 1.7.0.1 per: Directly calling json_encode() in front controller bypasses Symfony response headers; ajaxRender() should be used for CORS and CSRF consistency..
Ecco l'attuale implementazione:
function initContent()
{
parent::initContent();
$token = (string) Tools::getValue('token');
if (!GpsrApiKey::isValid($token)) {
$this->respondJson(['success' => false, 'error' => 'unauthorized'], 401);
}
$raw = file_get_contents('php://input');
Bisogna aggiornare i tipi nei parametri o la registrazione dell'hook sotto PHP 8.2? Qualcuno ha già risolto questo punto?