Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Workflow » Incorrect CSS settings
Incorrect CSS settings [message #7] Fri, 14 April 2006 02:08 Go to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
I run my apache server on http://localhost:8080 and I found a problem with the XML that gets sent to the client. It looks like the system is not sending the port for the machine.

<cssfiles> <filename>HTTP://localhost/radicore/style_default.css</filename>
<filename>HTTP://localhost/radicore/menu/style_custom.css</filename>
</cssfiles>

I have traced the problem to include.xml.php?.inc inside of the setCSSfiles(...) function. When building the filename values the string building function uses $_SERVER['SERVER_NAME'] when it should use $_SERVER['HTTP_HOST'].

Altering the code to the following resolved my problems:

// if no custom stylesheet is specified use 'style_custom.css' in local directory
if (empty($css_files)) {
$css_files[] = 'HTTP://' .$_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) .'/style_custom.css';
} // if

// prepend the default stylesheet name from base directory
$dir = getParentDIR();
if (!empty($_SERVER['HTTPS'])) {
$default_css = 'HTTP://' .$GLOBALS['https_server'] .$GLOBALS['https_server_suffix'] .$dir .'/style_default.css';
} else {
$default_css = 'HTTP://' .$_SERVER['HTTP_HOST'] .$dir .'/style_default.css';
} // if


Cheers,


Kyle Brost
----
Re: Incorrect CSS settings [message #9 is a reply to message #7] Fri, 14 April 2006 06:05 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Thanks for spotting that. It's always confusing when to use $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] as they supposedly give the same results except under circumstanes which are not documented.

I shall change my code for the next release.


Next Topic: time splits and workitems
Goto Forum:
  


Current Time: Thu Mar 28 10:35:06 EDT 2024

Total time taken to generate the page: 0.01024 seconds