mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #01794
[Bug 643503] Re: styles.css path is wrong for plugins on windows
Hi Andrew,
I'm running PHP 5.3.1 and on Windows, the DIRECTORY_SEPARATOR is a
backslash, leading to URLs like this within the HTML markup:
http://maharapod.localhost/artefact/file\theme/default/static/style/style.css
which don't resolve, e.g. when you visit
http://mahara.localhost/artefact/file/index.php where Firebug shows
that the above url hasn't resolved to a file, leaving the page without
some of its styling.
--
styles.css path is wrong for plugins on windows
https://bugs.launchpad.net/bugs/643503
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Status in Mahara ePortfolio: New
Bug description:
Using Mahara 1.2.6 on Windows XP and MySQL. Debugging using Firebug
The paths returned by $THEME->get_url() include use of DIRECTORY_SEPARATOR in the middle of a URL, which doesn't work.
The line caling it is 1029 of /artefact/form/elements/filebrowser.php:
$pluginsheets = $THEME->get_url('style/style.css', true, 'artefact/file');
And the function causing the problem is get_path() on line 697 of /ib/web.php, which can be fixed by altering line 699 to this:
$plugindirectory = ($plugindirectory && substr($plugindirectory, -1) != '/') ? $plugindirectory . '/' : $plugindirectory;
Original line 699:
$plugindirectory = ($plugindirectory && substr($plugindirectory, -1) != DIRECTORY_SEPARATOR) ? $plugindirectory . DIRECTORY_SEPARATOR : $plugindirectory;
References