Re: codefight cms could not get admin page

I think I got it fixed (not sure whether it’s the right fix). But it worked for me.

I found that the URI segment was combining the suffix (.HTML) with the last argument



e.g


http://www.myhost.com/user/register.html

it is considered as


http://www.myhost.com/user/register_html

I modified the URI.php library file to remove the suffix and then it started working.


Now everything did work fine.



The actual modification I made was to

function _explode_segments()
{
foreach(explode(”/”, preg_replace(”|/*(.+?)/*$|”, “\\1”, $this->uri_string)) as $val)
{
// Filter segments for security
$val = trim($this->_filter_uri($val));

if ($val != ‘’)
{
$this->segments[] = $val;
}
}
}

to this


function _explode_segments()
{
foreach(explode(”/”, preg_replace(”|/*(.+?)/*$|”, “\\1”, $this->uri_string)) as $val)
{
// Filter segments for security
$val = trim($this->_filter_uri($val));

if ($val != ‘’)
{
$this->segments[] = $val;
}
}

/* START:  Non CI code to solve the problem of suffix combining with the last argument */
if ($this->config->item(‘url_suffix’) != ‘’) {
$index = sizeof($this->segments);
$index -= 1;
$url_suffix = str_replace(”.”,“_”,$this->config->item(‘url_suffix’));
if (substr($this->segments[$index],(strlen($this->segments[$index]) - strlen($url_suffix)),strlen($url_suffix)) == $url_suffix) {
$this->segments[$index] = substr($this->segments[$index],0,(strlen($this->segments[$index]) - strlen($url_suffix)));
}
}
/* END:  Non CI code to solve the problem of suffix combining with the last argument */
}

Please let me know if this is the right solution or is there a proper solution to it. Thank you very much for your help!



Chaleswa

continue reading ...

 

 

 

Author chaleswa has posted total 9 posts.
click here To post comments on the above post.
Date: 01-04-2010 07:55:30am

 

 

You may also like:

And, Around the globe:

 

 

 

 1 2 3 4 >  Last ›
 


Page rendered in 2.2298 seconds

 
Powered by: Codefight CMS | A Damodar Bashyal Creation.