HTMLPurifier 4.4.0
|
00001 <?php 00002 00008 class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser 00009 { 00010 00011 protected function parseImplementation($var, $type, $allow_null) { 00012 return $this->evalExpression($var); 00013 } 00014 00015 protected function evalExpression($expr) { 00016 $var = null; 00017 $result = eval("\$var = $expr;"); 00018 if ($result === false) { 00019 throw new HTMLPurifier_VarParserException("Fatal error in evaluated code"); 00020 } 00021 return $var; 00022 } 00023 00024 } 00025 00026 // vim: et sw=4 sts=4