For a quick fix you can replace the line
'/\[color=(.*?)\](.*?)\[\/color\]/is',
with
'/\[color=([^;]*?)\](.*?)\[\/color\]/is',
This way it won't match on color-tags including a ;
, but still whatever the user enters behind =
will be in the <span>
-tag.
Another option (which may require more work) is to allow only certain colors:
'/\[color=(#\d{6}|green|blue|red|black)\](.*?)\[\/color\]/is',
This will allow hex colors (like #000000
) and green, blue, red and black... you're free to add other colors.