Forum OpenACS Development: external redirect on xowiki

Collapse
Posted by Iuri Sampaio on
I am trying to use API "ad_returnredirect" to link pages on xowiki to external sites. However i got the error bellow:

Is there another proc i can use instead?

Erro no includelet 'redirect':

Redirction to external hosts is not allowed.
while executing
"error "Redirction to external hosts is not allowed.""
(procedure "ad_returnredirect" line 13)
invoked from within
"ad_returnredirect $url "
(procedure "render" line 3)
invoked from within
"next"
(procedure "render" line 5)
::xotcl::__#G ::xowiki::includelet::decoration=portlet->render
invoked from within
"$includelet render"

Collapse
Posted by Iuri Sampaio on
So far i saw the code of ad_returnredirect was upadetd and that denies the eternal urls at proc ad_returnredirect unless the new argument allow_complete_url is set.

The new part of code of ad_returnredirect:

if {[util::external_url_p $target_url] && !$allow_complete_url_p} {
error "Redirction to external hosts is not allowed."
}

The question is how to use the switch "allow_complete_url"
in xowiki includelet

{{redirect -allow_complete_url -url http://mysite.com }}

Gives me error. Of course!! :)

Collapse
Posted by Iuri Sampaio on
The issue is solved.

{{redirect -url http://mysite.com }} is a customized includelet.

I went to the file packages/xowiki/tcl/includelet-procs.tcl and updated it as well to use the new switch.

Best wishes!

Collapse
Posted by Torben Brosten on
That limitation is for security reasons.

You can code a specific case by adding this html to the head area of an html page:
< META HTTP-EQUIV="Refresh"
Content = "10;
URL=http://mydomain.com";

(removing the space between < and META..)