From 3d4be2df51b386d27e35ff498a08d3ba91484721 Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Sun, 17 Sep 2006 20:37:54 +0000
Subject: [PATCH] =?UTF-8?q?les=20chemins=20d'icones=20des=20plugins=20ne?=
 =?UTF-8?q?=20necessitent=20plus=20de=20hack=20en=20faisant=20un=20../=20d?=
 =?UTF-8?q?epuis=20=5FDIR=5FIMG=5FPACK=20Si=20une=20icone=20est=20fournie?=
 =?UTF-8?q?=20sans=20path,=20on=20lui=20prefixe=20=5FDIR=5FIMG=5FPACK,=20s?=
 =?UTF-8?q?inon=20on=20considere=20qu'elle=20est=20fournie=20avec=20son=20?=
 =?UTF-8?q?chemin=20complet.=20Gestion=20du=20cas=20ou=20le=20path=20comme?=
 =?UTF-8?q?nce=20par=20"../".=5FDIR=5FPLUGINS=20qui=20correspond=20au=20ha?=
 =?UTF-8?q?ck=20anterieur=20et=20reste=20support=C3=A9=20pour=20assurer=20?=
 =?UTF-8?q?la=20compatibilit=C3=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/inc/minipres.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ecrire/inc/minipres.php b/ecrire/inc/minipres.php
index 67acad5788..206e28f44e 100644
--- a/ecrire/inc/minipres.php
+++ b/ecrire/inc/minipres.php
@@ -217,7 +217,14 @@ function http_wrapper($img){
 	static $wrapper_state=NULL;
 	static $wrapper_table = array();
 	
-	$f = _DIR_IMG_PACK . $img;
+	if (strpos($img,'/')===FALSE) // on ne prefixe par _DIR_IMG_PACK que si c'est un nom de fichier sans chemin
+		$f = _DIR_IMG_PACK . $img;
+	else { // sinon, le path a ete fourni
+		$f = $img;
+		// gerer quand meme le cas des hacks pre 1.9.2 ou l'on faisait un path relatif depuis img_pack
+		if (substr($f,0,strlen("../"._DIR_PLUGINS))=="../"._DIR_PLUGINS)
+			$f = substr($img,3); // on enleve le ../ qui ne faisait que ramener au rep courant
+	}
 	
 	if ($wrapper_state==NULL){
 		global $browser_name;
-- 
GitLab