- Timestamp:
- Nov 30, 2008, 1:53:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/plugins/LocalFilesEditor/functions.inc.php
r2788 r2915 31 31 { 32 32 $code = str_replace(array('<?php', '?>'), '', $code); 33 if ( !@eval('return true;' . $code))33 if (function_exists('token_get_all')) 34 34 { 35 return false; 35 $b = 0; 36 foreach (token_get_all($code) as $token) 37 { 38 if ('{' == $token) ++$b; 39 else if ('}' == $token) --$b; 40 } 41 if ($b) return false; 42 else 43 { 44 ob_start(); 45 $eval = eval('if(0){' . $code . '}'); 46 ob_end_clean(); 47 if ($eval === false) return false; 48 } 36 49 } 37 50 return '<?php' . $code . '?>';
Note: See TracChangeset
for help on using the changeset viewer.