Dotclear

Ticket #592 (closed defect: worksforme)

Opened 17 years ago

Last modified 16 years ago

Escapement problems in Clearbricks

Reported by: jcdubacq Owned by: xave
Priority: normal Milestone: 2.1.6
Component: module:clearbricks Version: 2.1
Severity: normal Keywords: clearbricks, escaping
Cc:

Description

When using a link having several % chars in it, such as the code inserted for a flashplayer movie:

<param name="FlashVars" value="title=Gwena%C3%ABl%20actionne%20la%20toupie&amp;margin=1&amp;showvolume=1&amp;showtime=1&amp;showfullscreen=1&amp;buttonovercolor=ff9900&amp;slidercolor1=cccccc&amp;slidercolor2=999999&amp;sliderovercolor=0066cc&amp;flv=http://blog.julietteroussel.fr/public/gwenael/2008/12/p1070239.flv&amp;width=400&amp;height=300" />

the function html::absoluteURLHandler in inc/clearbricks/common/lib.html.php (called e.g. in the generation of the atom/rss feed) does not escape the % chars before doing a sprintf (line 181). Thus, the %20a is understood as a (erroneous) sprintf specifications and generates an error message (too few arguments, IIRC).

The patch is simple enough:

Index: lib.html.php
===================================================================
--- lib.html.php	(révision 194)
+++ lib.html.php	(copie de travail)
@@ -163,7 +163,7 @@
 	{
 		$url = $m[2];
 		
-		$link = $m[1].'%s'.$m[3];
+		$link = preg_replace('|%|','%%',$m[1]).'%s'.preg_replace('|%|','%%',$m[3]);
 		$host = preg_replace('|^([a-z]{3,}://)(.*?)/(.*)$|','$1$2',self::$url_root);
 		
 		$parse = parse_url($m[2]);

Change History

comment:1 Changed 16 years ago by xave

  • Owner changed from olivier to xave
  • Status changed from new to assigned
  • Component changed from module:core to module:clearbricks
  • Milestone changed from 2.2 to 2.1.6

comment:2 Changed 16 years ago by xave

see also #720

comment:3 Changed 16 years ago by xave

  • Summary changed from Clearbricks does not escape %chars in urls before doing sprintf in absoluteURLHandler to Escapement problems in Clearbricks

Similar problems are to be found in #720 & #681. The solution should fix those ones also.

comment:4 Changed 16 years ago by xave

  • Status changed from assigned to closed
  • Resolution set to worksforme

I tried several combinations, it always works for me ...

Note: See TracTickets for help on using tickets.

Sites map