xfrocks
Well-known member
I have found an issue with the way XenForo_Application::resolveDynamicClass deals with fake class. It will generate invalid code if the $class is in some namespace.
Probably it needs to be process in the same way when creating $proxyClass?
PHP:
if ($fakeNeeded)
{
if (!$extend)
{
return false;
}
eval('class ' . $class . ' extends ' . $fakeBase . ' {}');
}
Probably it needs to be process in the same way when creating $proxyClass?
PHP:
// XenForo Class Proxy, in case you're wondering
$proxyClass = 'XFCP_' . $dynamicClass;
$namespaceEval = '';
$nsSplit = strrpos($dynamicClass, '\\');
if ($nsSplit !== false && $ns = substr($dynamicClass, 0, $nsSplit))
{
$namespaceEval = "namespace $ns; ";
$proxyClass = 'XFCP_' . substr($dynamicClass, $nsSplit + 1);
$createClass = '\\' . $createClass;
}
eval($namespaceEval . 'class ' . $proxyClass . ' extends ' . $createClass . ' {}');