Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2017-02-21 13:23:00 +0300
committerGitHub <noreply@github.com>2017-02-21 13:23:00 +0300
commit7ef892665d8e51471a0eb3fa93a4b0f9967278b7 (patch)
tree32fd7f9b5ae5423814241d8d4e0ec1f3d3027e7e /libs
parent9d9c82380c4cc6be9c771c7c22b00f8dacc04af6 (diff)
Implements fnmatch for those PHP without this function (#11369)
fixes #11237
Diffstat (limited to 'libs')
-rw-r--r--libs/upgradephp/upgrade.php10
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