From 3188eb175a076bfb06516d7527e6a6e4e0c283ce Mon Sep 17 00:00:00 2001
From: Matthieu Marcillaud <marcimat@rezo.net>
Date: Thu, 9 Oct 2014 17:53:03 +0000
Subject: [PATCH] =?UTF-8?q?Lors=20de=20l'utilisation=20dans=20un=20squelet?=
 =?UTF-8?q?te=20d'un=20filtre=20=20une=20erreur=20bloquante=20=C3=A9tait?=
 =?UTF-8?q?=20g=C3=A9n=C3=A9r=C3=A9e=20par=20PHP.=20Ferme=20#3282=20(merci?=
 =?UTF-8?q?=20witi).?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/public/sandbox.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ecrire/public/sandbox.php b/ecrire/public/sandbox.php
index dafcaffba1..7bc64d1bad 100644
--- a/ecrire/public/sandbox.php
+++ b/ecrire/public/sandbox.php
@@ -62,9 +62,14 @@ function sandbox_composer_filtre($fonc, $code, $arglist, &$p){
 	// le filtre est defini sous forme de fonction ou de methode
 	// par ex. dans inc_texte, inc_filtres ou mes_fonctions
 	elseif ($f = chercher_filtre($fonc)) {
+
 		// cas particulier : le filtre |set doit acceder a la $Pile
 		// proto: filtre_set(&$Pile, $val, $args...)
-		$refl = new ReflectionFunction($f);
+		if (strpbrk($f, ':')) { // Class::method
+			$refl = new ReflectionMethod($f);
+		} else {
+			$refl = new ReflectionFunction($f);
+		}
 		$refs = $refl->getParameters();
 		if (isset($refs[0]) AND $refs[0]->name == 'Pile') {
 			$code = "$f(\$Pile,$code$arglist)";
-- 
GitLab