Not a bug XF\DevelopmentOutput\Permission does not fully validate permission name

Xon

Well-known member
Affected version
2.2.6
While the entity validates the permission name, getEntityForImport does not validate the name is in the expected format (ie contains a - character);

PHP:
protected function getEntityForImport($name, $addOnId, $json, array $options)
{
   list($groupId, $permissionId) = explode('-', $name);

While this would most likely occur when importing potentially hand editor .json files, it would be nice if it gave a nicer error than;
Code:
Notice: Undefined offset: 1 ...
or php 8+;
Code:
Warning: Undefined array key 1 ...
 
I don't think we're going to progress this to a fix.

There must be multiple ways of causing similar issues with very little validation happening as it is and the lack of validation is because the files are automatically generated in the correct format.

We do not support hand editing dev output files and if issues arise as a result then that's an unfortunate side effect of doing something that is unsupported.
 
Top Bottom