themecontrol.php replacing {prepath} incorrectly

Bug #309365 reported by Todd
2
Affects Status Importance Assigned to Milestone
phpns
Fix Committed
High
Unassigned

Bug Description

{prepath} is not being replaced correctly by themecontrol.php when SSL is in use.

Revision history for this message
alecwh (alecwh) wrote :

Can you give some more details about the problem? What is the difference between SSL/non-SSL? What is being replaced, if anything?

Revision history for this message
Todd (tpat) wrote :

The problem lies at line 50 in themecontrol.php:

$file = str_replace('{prepath}','http://'.$_SERVER['SERVER_NAME'].$uri,$file);

In our case we are only using https. Therefore, every tag in the default theme that may use {prepath} for the url is incorrect. Right now it appears that the only tag using this is the link tag so the stylesheet is not loading.

A simple fix would be to check whether the server is using SSL or not:

$file = str_replace('{prepath}','http'.($_SERVER['HTTPS'] == "on" ? 's':'').'://'.$_SERVER['SERVER_NAME'].$uri,$file);

Revision history for this message
alecwh (alecwh) wrote :

Thanks for your fix. This will make it into the next patch/release!

Changed in phpns:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
alecwh (alecwh) wrote :

in the latest revision

Changed in phpns:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.