Flipkart

Wednesday, May 5, 2010

Codeigniter in PHP 5.3

First, here’s how to solve the issue regarding these errors:

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\ci\system\codeigniter\Common.php on line 130

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\ci\system\codeigniter\Common.php on line 136

In index.php in your CI folder replace line 12 “error_reporting(E_ALL);” (without quotes) with this:
error_reporting(E_ALL & ~E_DEPRECATED);” (without quotes)

Then, you’ll probably get an error about a bad URI if you try to run any controlls. It should say something like this: “The URI you submitted has disallowed characters.”


Here’s the solution for that as well. In URI.php which is located in \system\libraries replace line 189:
if ( ! preg_match("|^[".preg_quote($this->config->item
('permitted_uri_chars'))."]+$|i", $str))
” (without quotes and without the line break (it’s all one line)

to read like this:
if ( ! preg_match("|^[".str_replace('\\-', '-', preg_quote ($this->config->item('permitted_uri_chars')))."]+$|i", $str))” again without the quotes.

1 comment:

  1. this was help me to fixed. is there any security issue with this modification?

    ReplyDelete