note 63841 added to function.eval

From: Date: Sat, 01 Apr 2006 17:34:32 +0000
Subject: note 63841 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-107131@lists.php.net to get a copy of this message
Don't use eval to obfruscate code. Don't. No. stop. Never. Ever. It's so incredibly easy to decode, it's not worth it. <?php $someAwfulObfrsucatedCode = "1209;nlu[qer;j12.n"; function someImpressiveDeobfruscationRoutine($string){ ..somecode.. return $realCode; } eval(someImpressiveDeobfruscationRoutine($someAwfulObfruscatedCode)); ?> To decode, try replacing eval with echo, and voila, your code in-tact. Examples of misguided attempts at securing code with eval include base64[en|de]code and url[en|de]code, but regardless of your encoding/decoding skills and functions, replacing eval with echo will get the code back in all functions of this sort. ---- Server IP: 84.18.202.180 Probable Submitter: 88.104.58.134 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.eval.php Edit -- http://master.php.net/note/edit/63841 Del: integrated -- http://master.php.net/note/delete/63841/integrated Del: useless -- http://master.php.net/note/delete/63841/useless Del: bad code -- http://master.php.net/note/delete/63841/bad+code Del: spam -- http://master.php.net/note/delete/63841/spam Del: non-english -- http://master.php.net/note/delete/63841/non-english Del: in docs -- http://master.php.net/note/delete/63841/in+docs Del: other reasons-- http://master.php.net/note/delete/63841 Reject -- http://master.php.net/note/reject/63841 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#107131) next »