From 5e0a065ac25426428eb6843ee6652a9407f97cb3 Mon Sep 17 00:00:00 2001
From: renato <renato@rezo.net>
Date: Tue, 23 Jan 2007 15:05:31 +0000
Subject: [PATCH] bug when extracting attribute from nested tags

---
 ecrire/inc/filtres.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php
index 3f74ddde73..8fa0898544 100644
--- a/ecrire/inc/filtres.php
+++ b/ecrire/inc/filtres.php
@@ -1194,7 +1194,7 @@ function extraire_tag($texte, $tag) {
 function extraire_attribut($balise, $attribut, $complet = false) {
 	if (preg_match(
 //	',(.*?<[^>]*)(\s'.$attribut.'=\s*([\'"]?)([^\\3]*?)\\3)([^>]*>.*),isS',
-	',(.*?<(?:\s*+\w++(?:=(?:"[^"]*"|\'[^\']*\'|[^\'"]\S*))?)*?)(\s+'.$attribut.'(?:=\s*("[^"]*"|\'[^\']*\'|[^\'"]\S*))?)()([^>]*>.*),isS',
+	',(^[^<]*+<(?:\s*+\w++(?:=(?:"[^"]*"|\'[^\']*\'|[^\'"]\S*))?+)*?)(\s+'.$attribut.'(?:=\s*("[^"]*"|\'[^\']*\'|[^\'"]\S*))?)()([^>]*>.*),isS',
 	$balise, $r)) {
 		if ($r[3][0] == '"' || $r[3][0] == "'") {
 			$r[4] = substr($r[3], 1, -1);
-- 
GitLab