Condenser] Fix issue with page not loading when json_metadata tags field contains an Array of ArrayssteemCreated with Sketch.

in utopian-io •  7 years ago 

Condenser] Fix issue with page not loading when json_metadata tags field contains an Array of Arrays
image.png
Img Source

Issue
https://github.com/steemit/condenser/issues/2254
When a user submits a comment that has an Array of Arrays for the tags field, Condenser breaks due to expecting a single array.

Solution
When parsing the tags, concat the arrays together to create a single Array from the multiples if they exist.

Summary
Due to the fact that users are able to submit arbitrary data in the json_metadata field that Condenser parses, users are able to completely break their own account by submitting improperly formatted tags in the json_metadata. One user in particular @makafuigdzivenu encountered this issue and is unable to load any of his pages via Condenser. This pull request contains a quick solution to the problem by just concatenating multiple arrays in the tags field to just a single array.

Example Of Improperly Formatted JSON_METADATA
(tags should be an Array of strings)
json_metadata: {
tags: [['badtag']],
app: 'testpost',
community: 'testpost',
format: 'markdown+html'
}
Shoutout to @ makafuigdzivenu for reporting the original issue on steemit/condenser

Screenshots
Improperly formatted tags breaking Condenser
screen shot 2018-01-17 at 1 15 06 pm

Improperly formatted tags concatenated into a single Array works fine
screen shot 2018-01-17 at 1 42 05 pm

Links
Proof of Work Commit #9053d7f
SteemLiberator Condenser With This PR Live
Condenser Github Issue #2254
Upstream Condenser Pull Request

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://bitbin.it/2wTeblSa/