diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-23 02:15:07 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-23 02:15:07 +0400 |
commit | 0550fb10e93cfa4b116b28b7853e06d37733c392 (patch) | |
tree | 0675163157ef53a48874138647b1e3ff6d0f6e53 /core/Common.php | |
parent | 4ddd450d722b1fe96a9e875b4b76d03405947972 (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.php | 11 |
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. * |