diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index ac4f95f0f..538656a7e 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -28,6 +28,16 @@ abstract class Utils return $needle === '' || substr($haystack, -strlen($needle)) === $needle; } + /** + * @param string $haystack + * @param string $needle + * @return bool + */ + public static function contains($haystack, $needle) + { + return $needle === '' || strpos($haystack, $needle) !== false; + } + /** * Merge two objects into one. *