- Affected version
- 2.1.0+
Notices targeting particular page criteria via "Controller and action" with an action are unreliable, and the description text is now outright wrong.
During the XF2.1 update, the following was added to
An
The normalization should be apply after an
For notices, the action condition should go through the same normalization to ensure reliable action matching.
Example: AddOn\Path\To\ClassName :: methodName
Specify action name as personal-details, not actionPersonalDetails or personalDetails. You may leave the action blank to apply to all actions within the specified controller.
During the XF2.1 update, the following was added to
XF\Mv\Dispatcher::dispatchClass
PHP:
if ($action instanceof \Closure)
{
$action = $action($controller, $responseType, $params);
}
else
{
$action = preg_replace('#[^a-z0-9]#i', ' ', $action);
$action = str_replace(' ', '', ucwords($action));
}
An
$action
of personal-details
is normalized to PersonalDetails
, which means personal-details
doesn't match.The normalization should be apply after an
$action
closure is called, and it would make sense to simplify it to all lower-case during normalization as php function names are not case sensitive and it saves lower-casing it in a loop and/or whenever the action needs to be compared.For notices, the action condition should go through the same normalization to ensure reliable action matching.