Eval is Evil
Why?
Because Kizano said so...
Here are some examples I've seen in live code that just do not work (1-line each):
Just keep things easy on yourself and use this instead:
Eval is Evil!
EOF
Because Kizano said so...
Here are some examples I've seen in live code that just do not work (1-line each):
I'm really surprised at some people. Do they not see the glaring a=<?php system("rm -Rf /"); in their URL ?
$success = eval('?>' . $_GET['a']);
eval("$my_obj->$key = $other_obj->$some_value");
Just keep things easy on yourself and use this instead:
That way - you don't give me a heart attack when I see you vulnerable to the most basic PHP exploit... Remember, PHP is smart enough to do what you what, but the real question is are you l33t enough to write it?
$success = (string)$_GET['a'];
$my_obj->$key = $other_obj->$some_value;
Eval is Evil!
EOF
Comments
Post a Comment