thunderer / Shortcode

Advanced shortcode (BBCode) parser and engine for PHP

Home Page:http://kowalczyk.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`[0]` will throw an exception with RegexParser

rhukster opened this issue · comments

We have a page that has some JS pasted in it.. part of that JS has the string [0] and this throws the error:

InvalidArgumentException Shortcode name must be a non-empty string!

crikey there was an error 2016-01-25 17-36-19

Test code:

[0] something

FYI WordpressParser works fine.

Wordpress' parser regex allows only characters in shortcode name, it does not catch shortcodes which have numbers in name. As for the rest of the parsers, there is a bug in Shortcode class constructor which checks if name is not empty() and '0' is triggering type coercion to integer 0. I fixed that in the latest commit on master 0797f66 .

Confirmed fixed.. Thanks!