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
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2013-10-23 02:15:07 +0400
committerThomas Steur <thomas.steur@gmail.com>2013-10-23 02:15:07 +0400
commit0550fb10e93cfa4b116b28b7853e06d37733c392 (patch)
tree0675163157ef53a48874138647b1e3ff6d0f6e53 /core/Common.php
parent4ddd450d722b1fe96a9e875b4b76d03405947972 (diff)
refs #4126 differentiate between user and system settings to make a plugin developers live as easy and as secure as possible, add automatically validator in case field options are set, for security allow only names that are alNum
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Common.php b/core/Common.php
index 2c28ca720e..c07a73e292 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -619,6 +619,17 @@ class Common
return 'Unknown error';
}
+ public static function stringEndsWith($haystack, $needle)
+ {
+ if ('' === $needle) {
+ return true;
+ }
+
+ $lastCharacters = substr($haystack, -strlen($needle));
+
+ return $lastCharacters === $needle;
+ }
+
/**
* Returns the list of parent classes for the given class.
*