diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-02-21 13:23:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 13:23:00 +0300 |
commit | 7ef892665d8e51471a0eb3fa93a4b0f9967278b7 (patch) | |
tree | 32fd7f9b5ae5423814241d8d4e0ec1f3d3027e7e /libs | |
parent | 9d9c82380c4cc6be9c771c7c22b00f8dacc04af6 (diff) |
Implements fnmatch for those PHP without this function (#11369)
fixes #11237
Diffstat (limited to 'libs')
-rw-r--r-- | libs/upgradephp/upgrade.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/upgradephp/upgrade.php b/libs/upgradephp/upgrade.php index 8c29af7c3a..a945fa8ceb 100644 --- a/libs/upgradephp/upgrade.php +++ b/libs/upgradephp/upgrade.php @@ -710,4 +710,12 @@ if( !class_exists('\Error')) { class Error { } -}
\ No newline at end of file +} + +if(!function_exists('fnmatch')) { + + function fnmatch($pattern, $string) { + return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string); + } // end + +} // end if
\ No newline at end of file |