Re: [spip] 2 commits

Cerdic <[email protected]> Mon, 3 May 2021 09:04:52 +0200
Newsgroups gmane.comp.web.spip.cvs
Message-ID <123007fe-8c32-4353-9f19-f4d5b3ad0fb2@Spark>
Salut Arno*,

ce die() est pour le moins un peu violent, et même si en pratique la plupart des scripts finissent après l’appel à ajax_retour() il serait bien de l’éviter.

Je ne sais pas si tu préciser les conditions d’apparition du bug, mais je suppose que ça arrive dans le cas d’un json vide, ou un retour très court ?

Peux-tu tester le patch suivant et confirmer que ça règle aussi le problème de manière plus douce ?

diff --git a/ecrire/inc/actions.php b/ecrire/inc/actions.php
index 5ebfb7f2f4..0487de807f 100644
--- a/ecrire/inc/actions.php
+++ b/ecrire/inc/actions.php
@@ -142,5 +142,7 @@ function ajax_retour($corps, $content_type = null) {
 $debut = (($xml and strlen(trim($corps))) ? '<' . "?xml version='1.0' encoding='" . $c . "'?" . ">\n" : '');
 $fin = '';

-	die ($debut.$corps.$fin.$e);
+	echo $debut.$corps.$fin.$e;
+	while (ob_get_level()) ob_end_flush();
+	flush();
 }



--
Cédric
Le 1 mai 2021 à 21:15 +0200, ARNO* <[email protected]>, a écrit :
> spip/spip | 2 commits
> -
> Par ARNO*, le 26 avril 2021 à 16h27min :
>
> Label des saisies dans #wysiwyg
>
>
> *Modifié*
> prive/themes/spip/content.css.html
>
> Détails : https://git.spip.net/spip/spip/commit/79c6e58ad34e9779cbf7c7dddaba5950e0427035
>
> ==============================
> Par ARNO*, le 1er mai 2021 à 21h13min :
>
> Sur certain serveurs, echo non suivi de die() ne provoque aucun affichage.
>
>
> *Modifié*
> ecrire/inc/actions.php
>
> Détails : https://git.spip.net/spip/spip/commit/89795183b9dba6c792a58a1f217a7b0bb58523fb
>
> _______________________________________________
> [email protected] - https://listes.rezo.net/mailman/listinfo/spip-commit
> dev: http://trac.rezo.net/trac/spip/
_______________________________________________
[email protected] - https://listes.rezo.net/mailman/listinfo/spip-commit
dev: http://trac.rezo.net/trac/spip/