From: Arjen v. B. <boc...@fe...> - 2009-04-12 19:44:43
|
I am reluctant to submit this as a bug, because I would have imagined others would have noticed it before me, but I think there is something not quite right with the redirect from index.php I run phpESP from the root (eg. http://survey.example.com), therefore dirname($s['SCRIPT_NAME']) is not a directory but a single slash. As a result the following code $url = sprintf('%s://%s%s%s%s', $proto, $s['SERVER_NAME'], $port, dirname($s['SCRIPT_NAME']), '/admin/manage.php'); header("Location: $url"); redirects to http://survey.example.com//admin/manage.php The double slash results in the following page to links that point to http://admin/manage.php which obviously does not resolve to my domain. Maybe related is the following: I have this line in phpESP.ini.php $ESPCONFIG['base_url'] = $ESPCONFIG['proto'] . $server['HTTP_HOST'] . '/'; but all links I see in the Management Interface are relative. Arjen van Bochoven http://thebluebus.nl |
From: Franky V. L. <lie...@te...> - 2009-04-12 22:08:54
|
On Sun, 12 Apr 2009 21:44:26 +0200 Arjen van Bochoven <boc...@fe...> wrote: > I am reluctant to submit this as a bug, because I would have > imagined others would have noticed it before me, but I think there is > something not quite right with the redirect from index.php > > I run phpESP from the root (eg. http://survey.example.com), > therefore dirname($s['SCRIPT_NAME']) is not a directory but a single > slash. > > As a result the following code > > $url = sprintf('%s://%s%s%s%s', $proto, $s['SERVER_NAME'], $port, > dirname($s['SCRIPT_NAME']), '/admin/manage.php'); > > header("Location: $url"); > > redirects to > > http://survey.example.com//admin/manage.php > > The double slash results in the following page to links that point to > > http://admin/manage.php > > which obviously does not resolve to my domain. > > Maybe related is the following: I have this line in phpESP.ini.php > > $ESPCONFIG['base_url'] = $ESPCONFIG['proto'] . > $server['HTTP_HOST'] . '/'; > > but all links I see in the Management Interface are relative. > > Arjen van Bochoven > http://thebluebus.nl Hmmm ... I just tried the same thing here and don't see any problems. I don't see the double slashes as well. Which version are you using? Franky |
From: Arjen v. B. <boc...@fe...> - 2009-04-13 10:51:14
|
Looking at the test page, I see the following: Expected base_url: http://survey.example.com// As a workaround, I modified index.php to: $dir = dirname($s['SCRIPT_NAME']) == '/' ? '' : dirname($s['SCRIPT_NAME']); $url = sprintf('%s://%s%s%s%s', $proto, $s['SERVER_NAME'], $port, $dir, '/admin/manage.php'); grz Arjen |
From: Franky V. L. <lie...@te...> - 2009-04-13 11:34:13
|
On Mon, 13 Apr 2009 12:50:54 +0200 Arjen van Bochoven <boc...@fe...> wrote: > Looking at the test page, I see the following: > > Expected base_url: http://survey.example.com// > > As a workaround, I modified index.php to: > > $dir = dirname($s['SCRIPT_NAME']) == '/' ? '' : > dirname($s['SCRIPT_NAME']); > > $url = sprintf('%s://%s%s%s%s', $proto, $s['SERVER_NAME'], $port, > $dir, '/admin/manage.php'); > > > grz > > Arjen Ah yes, I see now ... my webserver (apache) automatically removes double slashes. Your fix has been accepted and is in SVN already. Franky |
From: Arjen v. B. <boc...@fe...> - 2009-04-13 11:58:10
|
Thanks! Adding base_url instead of ${base} to the Management interface urls probably would be a good thing as well. Arjen On 13 apr 2009, at 13:34, Franky Van Liedekerke wrote: > On Mon, 13 Apr 2009 12:50:54 +0200 > Arjen van Bochoven <boc...@fe...> wrote: > >> Looking at the test page, I see the following: >> >> Expected base_url: http://survey.example.com// >> >> As a workaround, I modified index.php to: >> >> $dir = dirname($s['SCRIPT_NAME']) == '/' ? '' : >> dirname($s['SCRIPT_NAME']); >> >> $url = sprintf('%s://%s%s%s%s', $proto, $s['SERVER_NAME'], $port, >> $dir, '/admin/manage.php'); >> >> >> grz >> >> Arjen > > Ah yes, I see now ... my webserver (apache) automatically removes > double slashes. Your fix has been accepted and is in SVN already. > > Franky > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > phpESP-general mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-general |