Page 1 of 1

if(!$tfile=@opendir("themes/$t_cookie[9]"))

Posted: Thu Apr 08, 2004 12:12 pm
by sutejok
I found this line in one of the PHP nuke files.
Can anyone tell me what is it checking?

if(!$tfile=@opendir("themes/$t_cookie[9]"))

and what is that =@ operator?

thx...

Posted: Thu Apr 08, 2004 12:18 pm
by markl999
@ supresses errors, so that line is trying to open a directory, if it can't open it for whatever reason then the error is supressed, ie you won't see it. If you removed the @ and the opendir failed, you'de see the error message it produced.

I've never once used @ in any functions, imho they should be handled 'nicely' i.e using things like file_exists() and is_readable() before atempting to open files/directories :o