Forum Moderators: coopster

Message Too Old, No Replies

Is it ok to have undefined offset and variabe errors?

         

kazisdaman3

9:20 pm on Feb 24, 2007 (gmt 0)

10+ Year Member



Does it really matter if I have undefined offset and undefined variable errors when I turn on all error reporting?

Is it just bad coding practices, it doesn't really make the site more vulnerable does it?

eelixduppy

9:48 pm on Feb 24, 2007 (gmt 0)




it doesn't really make the site more vulnerable does it?

More vulnerable, no. But it can lead to unexpected results depending on what you are doing. Usually to get around something like this, you would use isset [php.net] to check for existence before doing something with the variable.

kazisdaman3

10:04 pm on Feb 24, 2007 (gmt 0)

10+ Year Member



Thats a great suggestion,

thank you eelixduppy. I appreciate it!

eelixduppy

10:05 pm on Feb 24, 2007 (gmt 0)



You're welcome :)

Also take note that errors should be logged on a production site and not echoed to the browser (for security reasons). I'm not sure if that's what you meant by more vulnerable.