This is a static dump of issues in the old "Flyspray" bugtracker for DokuWiki. Bugs and feature requests
are now tracked at the issue tracker at Github.

Closed
Fixed

FS#1487 The chache methode of /lib/exe/js.php not suitable for multi homed wiki's

CSS, XHTML, JS, Browsers

2008-09-08szwww

The chache methode of /lib/exe/js.php not suitable for multi homed wiki's.

The generated javascript contains the current used host name and the generated output is stored in the chache for later usage.
example: var DOKU_BASE='http://example.com/wiki/';

If the wiki is accessible at both www.example.com and examle.com that the same chached javascript will be send every user regardeless the used host name. But the authetication is connected to the host name so some user won't be able to upload pictures and other media files.

Example:

John uses the address http://example.com/wiki/
John logs in and uploads a pictue.
The jvascript chached and conatins var DOKU_BASE='http://example.com/wiki/';

Bob uses the address http://www.example.com/wiki/
Bob logs in and tries to upload a pictue.
Bob receive the chached javascript which conatins: var DOKU_BASE='http://example.com/wiki/';
But the upload fails because authenticated at www.example.com and the media manager window opened from example.com and Bob doesn't have the appropriate cookies for example.com

Solution:
Generate different chache file name for different host names.
Change the 38th line of the js.php something like:
// The generated script depends on some dynamic options
$cache = getCacheName('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].$edit.'x'.$write,'.js');