Index: bbcode-filter.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bbcode/bbcode-filter.inc,v
retrieving revision 1.61
diff -u -r1.61 bbcode-filter.inc
--- bbcode-filter.inc 26 May 2007 08:28:34 -0000 1.61
+++ bbcode-filter.inc 2 Aug 2007 21:52:16 -0000
@@ -75,7 +75,7 @@
$arr = array(
'tag' => 'size',
'pattern' => '#\[\x07=([\d]+)(?::\w+)?\]([^\x07]*)\[/\x07(?::\w+)?\]#esi',
- 'replacement' => '"". stripslashes("$2") .""',
+ 'replacement' => '"". str_replace(\'\"\', \'"\', \'$2\') .""',
'text' => $body);
$body = _bbcode_replace_nest_tag($arr);
} // end processing for [size]
@@ -127,7 +127,7 @@
// replace to
/
/ tags
// It will be better to use &count and do-while, if php 5 or higher.
while (preg_match("#\[\x07[=]*((?-i)[cds1aAiI])*(?::\w+)?\]([^\x07]*)\[/\x07(?::\w+)?\]#si", $body)) {
- $body = preg_replace("#\[\x07[=]*((?-i)[cds1aAiI])*(?::\w+)?\]([^\x07]*)\[/\x07(?::\w+)?\]#esi", '"<". $l_type["$1"]["tag"] ." class=\"bb-list\" style=\"list-style-type:". $l_type["$1"]["style"] .";\">". "$2" ."". $l_type["$1"]["tag"] .">"', $body);
+ $body = preg_replace("#\[\x07[=]*((?-i)[cds1aAiI])*(?::\w+)?\]([^\x07]*)\[/\x07(?::\w+)?\]#esi", '"<". $l_type[\'$1\']["tag"] ." class=\"bb-list\" style=\"list-style-type:". $l_type[\'$1\']["style"] .";\">". str_replace(\'\"\', \'"\', \'$2\') ."". $l_type[\'$1\']["tag"] .">"', $body);
}
// remove
tags
Index: bbcode-test.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bbcode/bbcode-test.txt,v
retrieving revision 1.24
diff -u -r1.24 bbcode-test.txt
--- bbcode-test.txt 26 May 2007 08:28:34 -0000 1.24
+++ bbcode-test.txt 2 Aug 2007 21:52:16 -0000
@@ -22,6 +22,7 @@
Test [size=12]12px[/size] text
Test [size=24]24px[/size] text
Test [size=100]100px[/size] - too big, normalized to 48px
+[size=10] $_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\" [/size] - watch out for eval
[h3]Font faces[/h3]
Test [font=arial]Arial typeface[/font] text
@@ -172,14 +173,14 @@
[*]z
[/list]
-Alfa lowercase list (list=a):
+Alpha lowercase list (list=a):
[list=a]
[*]x
[*]y
[*]z
[/list]
-Alfa uppercase list (list=A):
+Alpha uppercase list (list=A):
[list=A]
[*]x
[*]y
@@ -217,6 +218,9 @@
[/list]
[/list]
+List with php content (watch out for eval):
+[list][*] {$var $_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\" [/list]
+
[h3]Table tags[/h3]
[table]