chromelogger icon indicating copy to clipboard operation
chromelogger copied to clipboard

Addslashes to REQUEST_URI

Open molokoloco opened this issue 11 years ago • 2 comments

I have the message : Warning: json_encode(): type is unsupported, encoded as null in C:\www\site\lib\chromephp\ChromePhp.php on line 396

Line 131, replace : $this->_json['request_uri'] = $_SERVER['REQUEST_URI']; With : $this->_json['request_uri'] = addslashes($_SERVER['REQUEST_URI']);

molokoloco avatar Apr 19 '13 12:04 molokoloco

Ah interesting. Really I should be using json_encode. I think I will probably just remove this completely though as it is not used by anything.

ccampbell avatar Apr 19 '13 12:04 ccampbell

This also causes an error when run from the cli. I use a filter in Laravel to capture SQL queries and output them with Chrome Logger. When running a migration or seeder from the cli, I get an error because the $_SERVER['REQUEST_URI'] index doesn't exist. Temp fix:

$this->_json['request_uri'] = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : 'cli://';

mloffer avatar Sep 13 '13 17:09 mloffer