Changeset 2914 for trunk/plugins/LocalFilesEditor
- Timestamp:
- Nov 30, 2008, 1:50:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/LocalFilesEditor/functions.inc.php
r2787 r2914 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.