Skip to content

Commit

Permalink
Implements fnmatch for those PHP without this function (#11369)
Browse files Browse the repository at this point in the history
fixes #11237
  • Loading branch information
mattab committed Feb 21, 2017
1 parent 9d9c823 commit 7ef8926
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libs/upgradephp/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,12 @@ function dump () {
class Error {

}
}
}

if(!function_exists('fnmatch')) {

function fnmatch($pattern, $string) {
return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end

} // end if

0 comments on commit 7ef8926

Please sign in to comment.