From eaa63b215f240dfbf3e63011b3b22a1cc6ea58a2 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Sat, 19 May 2007 05:24:38 +0000 Subject: [PATCH] =?UTF-8?q?En=20fait=20c'est=20la=20contrapos=C3=A9e=20de?= =?UTF-8?q?=20[9323]=20qu'il=20faut:=20le=20hack=20d'envoyer=20du=20conten?= =?UTF-8?q?u=20al=C3=A9atoire=20pour=20cron=20et=20cookie=20venait=20de=20?= =?UTF-8?q?notre=20ignorance=20du=20code=20de=20retour=20204.=20A=20pr?= =?UTF-8?q?=C3=A9sent=20on=20envoie=20204,=20et=20envoie=5Fimage=5Fvide=20?= =?UTF-8?q?devient=20inutile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/action/cookie.php | 3 ++- ecrire/inc/headers.php | 3 ++- ecrire/inc/utils.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ecrire/action/cookie.php b/ecrire/action/cookie.php index 7b7c7eda64..e78d3b40af 100644 --- a/ecrire/action/cookie.php +++ b/ecrire/action/cookie.php @@ -26,7 +26,8 @@ function action_cookie_dist() { if (_request('change_session') == 'oui') { $session = charger_fonction('session', 'inc'); $session(true); - envoie_image_vide(); + spip_log("statut 204 pour " . $_SERVER['REQUEST_URI']); + http_status(204); // No Content return; } diff --git a/ecrire/inc/headers.php b/ecrire/inc/headers.php index c279c81804..93d0bdb2b1 100644 --- a/ecrire/inc/headers.php +++ b/ecrire/inc/headers.php @@ -97,8 +97,8 @@ function http_no_cache() { header("Pragma: no-cache"); } +/* Code mort: le statut 204 c'est fait pour. -// envoi de l'image demandee dans le code ci-dessus // http://doc.spip.org/@envoie_image_vide function envoie_image_vide() { $image = pack("H*", "47494638396118001800800000ffffff00000021f90401000000002c0000000018001800000216848fa9cbed0fa39cb4da8bb3debcfb0f86e248965301003b"); @@ -110,6 +110,7 @@ function envoie_image_vide() { echo $image; flush(); } +*/ // http://doc.spip.org/@generer_test_dirs function generer_test_dirs($arg='', $redirect=false) diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index 229b192913..f1fe1b71eb 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -616,7 +616,9 @@ function spip_touch($fichier, $duree=0, $touch=true) { // http://doc.spip.org/@action_cron function action_cron() { include_spip('inc/headers'); - envoie_image_vide(); + // envoie_image_vide(); + http_status(204); // No Content + header("Connection: close"); cron (1); } -- GitLab