Commit cab0b71d authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_web: WebSite_login: make sure that there is a came_from

defined before using it as argument for isURLAncestorOf.

@vpelletier, this caused a bug, since empty came_from would crash isURLAncestorOf when urlparse is called for this url (https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5Type/Core/Folder.py#L517). I think this is a way to solve, I do not know if isURLAncestorOf should be changed also to return something in such situation. 

/reviewed-on !89
parent f11f3869
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
came_from python: request.get('came_from') or request.get('field_came_from'); came_from python: request.get('came_from') or request.get('field_came_from');
isAnon here/portal_membership/isAnonymousUser | nothing; isAnon here/portal_membership/isAnonymousUser | nothing;
url_topmost_document python: here.Base_getURLTopmostDocumentValue(); url_topmost_document python: here.Base_getURLTopmostDocumentValue();
came_from_valid python: url_topmost_document.isURLAncestorOf(came_from);"> came_from_valid python: not came_from or url_topmost_document.isURLAncestorOf(came_from);">
<tal:block tal:condition="isAnon"> <tal:block tal:condition="isAnon">
<tal:block tal:define="dummy python: response.expireCookie('__ac', path='/'); <tal:block tal:define="dummy python: response.expireCookie('__ac', path='/');
url python: '%s/login_form?portal_status_message=%s' % (here.absolute_url(), here.Base_translateString('Login and/or password is incorrect.')); url python: '%s/login_form?portal_status_message=%s' % (here.absolute_url(), here.Base_translateString('Login and/or password is incorrect.'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment