new list processing code (in HEAD) has some error.. try this text:

[list]
[*] {$var
[/list]

I got this:

Fatal error: preg_replace() [function.preg-replace]: Failed evaluating code: "<". $l_type[""]["tag"] ." class=\"bb-list\" style=\"list-style-type:". $l_type[""]["style"] .";\">". " <li> {$var</li> " ."</". $l_type[""]["tag"] .">"
CommentFileSizeAuthor
#5 bbcode_eval_patch.txt2.75 KBmindless

Comments

mindless’s picture

Also try:

[list]
[*] $_SERVER[PHP_SELF]
[/list]

The variable is expanded!

mindless’s picture

[size=15] $_SERVER[PHP_SELF] [/size]

naudefj’s picture

Priority: Normal » Critical

We need to get this fixed ASAP.

Would you be able to prepare a patch?

mindless’s picture

yes, it will be ready within the hour.

mindless’s picture

Status: Active » Needs review
StatusFileSize
new2.75 KB

Patch attached. 2 fixes: the main one is changing ".." to '..' in the regexps using the "e" (eval) modifier. This prevents variables from being expanded. After that the only problem was " being changed to \", as preg_replace escapes both single and double quotes. The [size] code already had stripslashes, but this is too much as it would change \a to a.. we only want to strip the backslash from " characters where it was added. So I used str_replace.

naudefj’s picture

Assigned: Unassigned » naudefj
Status: Needs review » Fixed

Patch was applied - http://drupal.org/cvs?commit=76137

Thank you very much Alan!

Anonymous’s picture

Status: Fixed » Closed (fixed)