plone / plone.app.blocks

A 'blocks' rendering model for Plone
https://pypi.python.org/pypi/plone.app.blocks
Other
11 stars 4 forks source link

resolveResource break when url html content contains other ++-url's #78

Closed MrTango closed 5 years ago

MrTango commented 5 years ago

If the url contains html content with resource url like ++resource++protect.js the resolveResource breaks.

2019-07-04T10:11:34 ERROR plone.app.blocks There was an error while resolving the tile: https://example.de/libraries/university-library/university-library-neu/@@plone.app.standardtiles.html/958ba5af-12aa-4c37-a551-3df744a57788?content=%3Cp%3ELorem%20ipsum%20dolor%20sit%20amet,%20consectetuer%20adipiscing%20elit.%20Sed%20posuere%20interdum%20sem.%20Quisque%20ligula%20eros%20ullamcorper%20quis,%20lacinia%20quis%20facilisis%20sed%20sapien.%20Mauris%20varius%20diam%20vitae%20arcu.%20Sed%20arcu%20lectus%20auctor%20vitae,%20consectetuer%20et%20venenatis%20eget%20velit.%20Sed%20augue%20orci,%20lacinia%20eu%20tincidunt%20et%20eleifend%20nec%20lacus.%3C/p%3E%0A%3Cp%3EDonec%20ultricies%20nisl%20ut%20felis,%20suspendisse%20potenti.%20Lorem%20ipsum%20ligula%20ut%20hendrerit%20mollis,%20ipsum%20erat%20vehicula%20risus,%20eu%20suscipit%20sem%20libero%20nec%20erat.%20Aliquam%20erat%20volutpat.%20Sed%20congue%20augue%20vitae%20neque.%20Nulla%20consectetuer%20porttitor%20pede.%20Fusce%20purus%20morbi%20tortor%20magna%20condimentum%20vel,%20placerat%20id%20blandit%20sit%20amet%20tortor.%3C/p%3E%0A&content=%3Cp%3ELorem%20ipsum%20dolor%20sit%20amet,%20consectetuer%20adipiscing%20elit.%20Sed%20posuere%20interdum%20sem.%20Quisque%20ligula%20eros%20ullamcorper%20quis,%20lacinia%20quis%20facilisis%20sed%20sapien.%20Mauris%20varius%20diam%20vitae%20arcu.%20Sed%20arcu%20lectus%20auctor%20vitae,%20consectetuer%20et%20venenatis%20eget%20velit.%20Sed%20augue%20orci,%20lacinia%20eu%20tincidunt%20et%20eleifend%20nec%20lacus.%3C/p%3E%0A%3Cp%3EDonec%20ultricies%20nisl%20ut%20felis,%20suspendisse%20potenti.%20Lorem%20ipsum%20ligula%20ut%20hendrerit%20mollis,%20ipsum%20erat%20vehicula%20risus,%20eu%20suscipit%20sem%20libero%20nec%20erat.%20Aliquam%20erat%20volutpat.%20Sed%20congue%20augue%20vitae%20neque.%20Nulla%20consectetuer%20porttitor%20pede.%20Fusce%20purus%20morbi%20tortor%20magna%20condimentum%20vel,%20placerat%20id%20blandit%20sit%20amet%20tortor.%3C/p%3E%0A%3Cscript%20type=%22application/javascript%22%20id=%22protect-script%22%20src=%22../../../++resource++protect.js%22%20data-token=%2255742a880cb1e005b07a1b266b8396bb513c1863%22%20data-site-url=%22http://example.de%22%3E%3C/script%3E%0A&&content=%3Cp%3ELorem%20ipsum%20dolor%20sit%20amet,%20consectetuer%20adipiscing%20elit.%20Sed%20posuere%20interdum%20sem.%20Quisque%20ligula%20eros%20ullamcorper%20quis,%20lacinia%20quis%20facilisis%20sed%20sapien.%20Mauris%20varius%20diam%20vitae%20arcu.%20Sed%20arcu%20lectus%20auctor%20vitae,%20consectetuer%20et%20venenatis%20eget%20velit.%20Sed%20augue%20orci,%20lacinia%20eu%20tincidunt%20et%20eleifend%20nec%20lacus.%3C/p%3E%0A%3Cp%3EDonec%20ultricies%20nisl%20ut%20felis,%20suspendisse%20potenti.%20Lorem%20ipsum%20ligula%20ut%20hendrerit%20mollis,%20ipsum%20erat%20vehicula%20risus,%20eu%20suscipit%20sem%20libero%20nec%20erat.%20Aliquam%20erat%20volutpat.%20Sed%20congue%20augue%20vitae%20neque.%20Nulla%20consectetuer%20porttitor%20pede.%20Fusce%20purus%20morbi%20tortor%20magna%20condimentum%20vel,%20placerat%20id%20blandit%20sit%20amet%20tortor.%3C/p%3E%0A&X-Tile-Persistent=yes
Traceback (most recent call last):
  File "/usr/local/plone-5.1/example/checkout/src/plone.app.blocks/plone/app/blocks/utils.py", line 74, in resolve
    resolved = resolveResource(url)
  File "/usr/local/plone-5.1/example/checkout/src/plone.app.blocks/plone/app/blocks/utils.py", line 122, in resolveResource
    _, resource_type, path = path.split('++')
ValueError: need more than 1 value to unpack