mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-25 13:33:51 -04:00
FIX: Ning json can have square brackets instead of commas
This commit is contained in:
parent
9584990477
commit
ef482591bf
1 changed files with 5 additions and 0 deletions
|
@ -51,7 +51,12 @@ class ImportScripts::Ning < ImportScripts::Base
|
|||
def repair_json(arg)
|
||||
arg.gsub!(/^\(/, "") # content of file is surround by ( )
|
||||
arg.gsub!(/\)$/, "")
|
||||
|
||||
arg.gsub!(/\}\{/, "},{") # missing commas sometimes!
|
||||
|
||||
arg.gsub!("}]{", "},{") # surprise square brackets
|
||||
arg.gsub!("}[{", "},{") # :troll:
|
||||
|
||||
arg
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue