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

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -