Piwik Notices

Hi Guys,

I’ve got an install of Piwik running one of my development servers with XDebug->Scream on. There’s a few notices relating to undefined array indexes being thrown up. Some of them are being suppressed such as in core/common.php:

$remoteAddr = @$_SERVER['REMOTE_ADDR'];

Surely suppressing these things isn’t the best practise? We’re using assigning a variable to the value of the array at an undefined index which in any other language would be fatal. For this specific case its used in the isPhpCliMode() function where immediately after the variable is used with empty() so I guess the only reason its even being assigned to a variable there is for code clarity.

I guess what I’m really asking is, is this standard practise on the project or is it worth raising low-priority tickets for these?

Please be specific about which errors you’re seeing etc. Usually we do this for good reasons but yes, would be good to test with !empty(). please propose patch if you want us to fix this!