Skip to content

Commit

Permalink
Add warning to people who might want to use this function incorrectly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudd-O authored Sep 7, 2022
1 parent 991cd48 commit a80196c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plone/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ def _top_request(req):

def get_top_site_from_url(context, request):
"""Find the top-most site, which is still in the url path.
Use this method if you need a "root object" reference to generate URLs
that will be used by, and will work correctly from the standpoint of,
*browser* code (JavaScript / XML HTTP requests) after virtual hosting has
been applied. *Never* use this to get to a site root in Plone server code
-- it is not appropriate for that use.
If the current context is within a subsite within a PloneSiteRoot and no
virtual hosting is in place, the PloneSiteRoot is returned.
Expand Down

0 comments on commit a80196c

Please sign in to comment.