Fix improper handling of IE conditional comments.
[htmlpurifier.git] / library / HTMLPurifier / VarParser / Native.php
blobb02a6de54ca269f744ab60a9d6ba1374894a9d43
1 <?php
3 /**
4 * This variable parser uses PHP's internal code engine. Because it does
5 * this, it can represent all inputs; however, it is dangerous and cannot
6 * be used by users.
7 */
8 class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser
11 protected function parseImplementation($var, $type, $allow_null) {
12 return $this->evalExpression($var);
15 protected function evalExpression($expr) {
16 $var = null;
17 $result = eval("\$var = $expr;");
18 if ($result === false) {
19 throw new HTMLPurifier_VarParserException("Fatal error in evaluated code");
21 return $var;
26 // vim: et sw=4 sts=4