I'm always completely at loss with regexes so I hope someone here can help.
Joomla uses this regex to validate lines of ini files:
/^(|(\[[^\]]*\])|([A-Z][A-Z0-9_\-]*\s*=(\s*(("[^"]*")|(_QQ_)))+))\s*(;.*)?$/
The lines have this format
JLIB_LOGIN_AUTHENTICATE="Username and password do not match or you do not have an account yet."
Obviously "
can't be allowed in the value part but \"
could be. Currently this is matched by the above regex. I can see how it's matched but I can't modify the regex not to match \"
. I tried adding |(\Q\"\E)
to various places but no luck.
Change this:
"[^"]*"
To this:
"(\\"|[^"])*"
See it working online: ideone
replace [^"]
with ([^"]|(\\"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With