fixed a bug in parser

we need to check the index otherwise we get out of range on broken syntax
Merge branch 'master' into 3.1.0.0/multisite