XH 1.5.7: REQUEST_URI

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

XH 1.5.7: REQUEST_URI

Post by cmb » Tue Mar 26, 2013 6:15 pm

Hello Community,

in http://cmsimpleforum.com/viewtopic.php?f=6&t=5969 it was pointed out, that $_SERVER['REQUEST_URI'] throws the notice "Undefined index: REQUEST_URI", as this CGI variable is not part of the CGI specification (RFC 3875), and not set by IIS (and perhaps other web servers).

It is used unconditionally in only one place in the core (cmsimple/cms.php line 126). In my reply to the report I suggested as quick fix to use SCRIPT_NAME instead. But I'm not sure, that using SCRIPT_NAME generally fits (cf. http://cmsimpleforum.com/viewtopic.php?f=6&t=5444). Any ideas?

Anyway, we should fix this issue for 1.5.7 somehow.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.5.7: REQUEST_URI

Post by cmb » Fri Apr 26, 2013 12:33 pm

cmb wrote:that $_SERVER['REQUEST_URI'] throws the notice "Undefined index: REQUEST_URI"
To clarify: the effect was that subsites did not work on such servers.

I have fixed that now for CMSimple_XH 1.5.7 in a way that should not change behavior for installations where it already worked:

Code: Select all

$temp = isset($_SERVER['REQUEST_URI'])
    ? str_replace($_SERVER['QUERY_STRING'],'',$_SERVER['REQUEST_URI'])
    : $_SERVER['SCRIPT_NAME'];
$subsite_folder_array = explode('/', $temp); // creates array   
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply