Replace the class in vault/core/model/parser/default/wrapper/vw.php with the following:
Code:
class vw_Parser_Default_Wrapper_Model
{
public $instance;
protected $class;
protected $parser;
protected $reflection_cache = array();
public function _construct_delayed(&$parser, &$instance)
{
$this->parser =& $parser;
$this->instance =& $instance;
foreach (get_object_vars($parser) AS $property => $blah)
{
if (!isset($this->$property))
{
$this->$property =& $this->parser->$property;
}
}
}
public function __call($name, $args)
{
if (!is_object($this->parser))
{
trigger_error("Call to a method <b>$name</b> on a non-object.", E_USER_ERROR);
exit;
}
if (!method_exists($this->parser, $name))
{
trigger_error('Method <b>' . get_class($this->parser) . '::' . $name . '</b> is undefined.', E_USER_ERROR);
exit;
}
$ref = new ReflectionMethod($this->parser, $name);
if ($ref->isPublic())
{
return call_user_func_array(array($this->parser, $name), $args);
}
else
{
return null;
}
}
public function get($key)
{
if (isset($this->$key))
{
return $this->$key;
}
else if (!array_key_exists($key, $this->reflection_cache))
{
if (is_object($this->parser) AND property_exists($this->parser, $key))
{
$ref = new ReflectionProperty($this->parser, $key);
if ($ref->isPublic())
{
$this->reflection_cache["$key"] =& $this->parser->$key;
}
else
{
$ref->setAccessible(true);
return $ref->getValue($this->parser);
}
}
else
{
return null;
}
}
return $this->reflection_cache["$key"];
}
public function get_class()
{
if ($this->class === null)
{
$tmp = $this->get('class');
if ($tmp)
{
$this->class = $tmp;
}
else
{
$this->class = 'bbcode';
}
}
return $this->class;
}
}
Please let me know today if this causes a problem with BB-Codes working or anything like that.
Tested on PHP 7.1.0-dev, PHP 5.4.3, and PHP 5.3.4.
Bookmarks