Especially with merge tags there are some regexps used, which also allow no characters.
As there is always at least one character needed, the regexp could be improved.
I.e. instead of
if ( preg_match_all( "/{(.*?)}/", $input, $matches ) ) {
use
if ( preg_match_all( "/{(.+?)}/", $input, $matches ) ) {
(it could even be better to at least restrict the allowed symbols to only a very specific subset of characters (like the slug))
This is a smaller improvement.
Especially with merge tags there are some regexps used, which also allow no characters. As there is always at least one character needed, the regexp could be improved.
I.e. instead of
if ( preg_match_all( "/{(.*?)}/", $input, $matches ) ) {
use
if ( preg_match_all( "/{(.+?)}/", $input, $matches ) ) {
(it could even be better to at least restrict the allowed symbols to only a very specific subset of characters (like the slug))