Page MenuHomePhabricator

Schema namespace edits turn '/' into "\/"
Closed, ResolvedPublic

Description

See https://meta.wikimedia.org/w/index.php?title=Schema:Sandbox&oldid=4856746

JSONlint.com doesn't think escaping a forward slash with backslash is required.


Version: unspecified
Severity: enhancement

Details

Reference
bz43214

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 12:52 AM
bzimport set Reference to bz43214.

swalling wrote:

I switched it to commas, for now, FYI.

It's not required, but it's also not wrong. You can enter a single slash in the edit screen, but I don't think we should worry about this canonicalization.

It looks like the real problem was the FormatJson::encode call in objectRow. That's why it looked like that in the pretty HTML version.

It turns out this is useful for other types. Otherwise, true becomes 1. However, it reencodes strings, which we don't want.

Hence, https://gerrit.wikimedia.org/r/39175

This also means instead of (type) ("number") it will be (type) (number). I think that's a feature, since this is an HTML structural view.

ori added a comment.Dec 19 2012, 9:46 AM

It's not wrong, but it's an unintended side-effect of pre-save beautification. The resultant JSON is logically equivalent, however. When we migrate to PHP 5.4 we'll be able to use the JSON_UNESCAPED_SLASHES bit when invoking json_encode().

[Using "RESOLVED LATER" is deprecated, hence reopening with lowest prio.]

Ori: See gerrit 50140.

ori added a comment.Apr 15 2013, 4:59 PM

(In reply to comment #5)

Ori: See Gerrit change #50140.

Oh, wonderful. Thank you very much.

[moving from MediaWiki extensions to Analytics product - see bug 61946]