Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -N -r1.141.2.1 -r1.141.2.2 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 10 Mar 2019 21:19:39 -0000 1.141.2.1 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 18 Mar 2019 15:07:04 -0000 1.141.2.2 @@ -609,7 +609,9 @@ {-url:required} } { Returns 1 if a site node exists at the given url and 0 otherwise. - + The provided URL has to start with a slash. + + @param url URL path starting with a slash. @author Peter Marklund } { set url_no_trailing [string trimright $url "/"] @@ -1768,15 +1770,17 @@ {-url:required} } { Returns 1 if a site node exists at the given url and 0 otherwise. - } { - set url_no_trailing [string trimright $url "/"] - - # get_node_id returns always a node_id, which might be the node_id - # of the root. In order to check, whether the provided url is - # really a site-node, we do an inverse lookup and check whether - # the returned node_id has the same url as the provided one. + @param url URL path starting with a slash. + } { + set url_no_trailing [expr {"url" eq "/" ? "/" : [string trimright $url "/"]}] # + # The function "get_node_id" returns always a node_id, which + # might be the node_id of the root. In order to check, whether + # the provided URL is really a site-node, we do an inverse + # lookup and check whether the returned node_id has the same + # URL as the provided one. + # set node_id [::xo::site_node get_node_id -url $url_no_trailing] return [expr {[::xo::site_node get_url -node_id $node_id] eq "$url_no_trailing/"}] }