Fixed XF\Util\Php::validateCallback does not handle multiple \\ in namespace paths

Xon

Well-known member
Affected version
2.1.8
If you paste XF\\Option\\UserGroup::renderSelect into an XF:Option's "Format parameters" for a 'php callback' option, instead of a nice error it instead gives;

Code:
Fatal error: Cannot declare class XF\Option\UserGroup, because the name is already in use in /var/www/html/src/XF/Option/UserGroup.php on line 0

Having multiple \ in the classname path should probably be treated as an error so the class loader system doesn't render random parts of the forum inaccessible. I assume this affects things like class extensions, code event listeners, etc.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.10).

Change log:
Don't allow double backslashes for PHP callbacks.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom