Page MenuHomePhabricator

VisualEditor: modules/syntaxhighlight/rules/mysql.json has unescaped double quotes in a double quoted string
Closed, ResolvedPublic

Description

The file modules/syntaxhighlight/rules/mysql.json has at least one double quoted string containing unescaped double quotes. I.e something like:

{
"match" : """
}

That cause PHP json_decode() to choke with a syntax error. I wrote a json linter to lint json files in Jenkins. You can try it using integration/jenkins.git and running bin/json-lint.php

./modules/syntaxhighlight/rules/mysql.json: Syntax error


Version: unspecified
Severity: normal

Details

Reference
bz61659

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:54 AM
bzimport added a project: VisualEditor.
bzimport set Reference to bz61659.

Change 114518 had a related patch set uploaded by Jforrester:
Fix broken JSON in modules/syntaxhighlight/rules/mysql.json

https://gerrit.wikimedia.org/r/114518

(In reply to Antoine "hashar" Musso from comment #0)

The file modules/syntaxhighlight/rules/mysql.json has at least one double
quoted string containing unescaped double quotes. I.e something like:

{
"match" : """
}

That cause PHP json_decode() to choke with a syntax error. I wrote a json
linter to lint json files in Jenkins. You can try it using
integration/jenkins.git and running bin/json-lint.php

./modules/syntaxhighlight/rules/mysql.json: Syntax error

It's in a file that's not currently used (the code needs some work), but I've fixed it.

Change 114518 merged by jenkins-bot:
Fix broken JSON in modules/syntaxhighlight/rules/mysql.json

https://gerrit.wikimedia.org/r/114518

The PHP json_decode() no more reports any error. Thank you!

hashar@gallium:~/extensions$ /srv/deployment/integration/slave-scripts/bin/json-lint.php VisualEditor/; echo $?
0
hashar@gallium:~/extensions$