[Condenser] Fix issue with page not loading when json_metadata tags field contains an Array of Arrays


SUBMITTED BY: PimpTheRomeo

DATE: Jan. 18, 2018, 4:39 p.m.

FORMAT: Text only

SIZE: 1.5 kB

HITS: 651

  1. Issue
  2. https://github.com/steemit/condenser/issues/2254
  3. When a user submits a comment that has an Array of Arrays for the tags field, Condenser breaks due to expecting a single array.
  4. Solution
  5. When parsing the tags, concat the arrays together to create a single Array from the multiples if they exist.
  6. Summary
  7. 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.
  8. Example Of Improperly Formatted JSON_METADATA
  9. (tags should be an Array of strings)
  10. json_metadata: {
  11. tags: [['badtag']],
  12. app: 'testpost',
  13. community: 'testpost',
  14. format: 'markdown+html'
  15. }
  16. Shoutout to @ makafuigdzivenu for reporting the original issue on steemit/condenser
  17. Screenshots
  18. Improperly formatted tags breaking Condenser
  19. screen shot 2018-01-17 at 1 15 06 pm
  20. Improperly formatted tags concatenated into a single Array works fine
  21. screen shot 2018-01-17 at 1 42 05 pm
  22. Links
  23. Proof of Work Commit #9053d7f
  24. SteemLiberator Condenser With This PR Live
  25. Condenser Github Issue #2254
  26. Upstream Condenser Pull Request
  27. Posted on Utopian.io - Rewarding Open Source Contributors

comments powered by Disqus