Open tvb opened 10 years ago
Remove control characters from the post.
//$sender->content = preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $sender->content);
// \[ (i|b|color|url|somethingelse) \=? ([^]]+)? \] (?: ([^]]*) \[\/\1\] )
Wouldn't it be better to incorporate something like https://github.com/milesj/decoda
If you're considering using a BBCode library I'd like to suggest my own, which you can find at https://github.com/s9e/TextFormatter
It's a text formatting library with a BBCode plugin. It supports any number of custom BBCodes, or if you don't want to create your own BBCodes you can use a premade bundle. If all you want are the 6 basic BBCodes I see in your current BBCode plugin, this may be overkill. You might as well keep your custom solution if it works for you.
Yeah, we should definitely be using a library instead of homebrew code
Maybe should be changed to textile / markdown format? Should be much more comfortable typing a post from mobile ;)
http://stackoverflow.com/questions/1799454/is-there-a-solid-bb-code-parser-for-php-that-doesnt-have-any-dependancies/1799788#1799788