From 7ef892665d8e51471a0eb3fa93a4b0f9967278b7 Mon Sep 17 00:00:00 2001 From: Matthieu Aubry Date: Tue, 21 Feb 2017 11:23:00 +0100 Subject: Implements fnmatch for those PHP without this function (#11369) fixes #11237 --- libs/upgradephp/upgrade.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs') 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 -- cgit v1.2.3