php - fnmatch() returning false with pure wildcard -
i have following code:
echo "matching: ".$params['perm']." against: "; var_dump($perm); if (fnmatch($params['perm'], $perm)) { $x=true; } $this->code = 200; return $x;
for asking if $perm
contains start of $params['perm']
or *
in case output is:
matching: acl.adduser against: array(1) { [0]=> string(1) "*" } {"code":200,"data":false}
shouldn't return true since *
permission have, , allows me own acl.adduser
?
$perm
supposed string, while in example array. fnmatch
not work correctly in case, , should have seen php warning this.
also, order of arguments appears reversed. test works expected:
var_dump(fnmatch('*', 'acl.adduser'));
Comments
Post a Comment