You are here

public function StatusHeartPost::strposMultiple in Heartbeat 8

1 call to StatusHeartPost::strposMultiple()
StatusHeartPost::verifyExtension in modules/statusmessage/src/StatusHeartPost.php

File

modules/statusmessage/src/StatusHeartPost.php, line 226

Class

StatusHeartPost
@property \Drupal\statusmessage\MarkupGenerator generator @property message

Namespace

Drupal\statusmessage

Code

public function strposMultiple($string, $patterns) {
  $patterns = is_array($patterns) ? $patterns : is_object($patterns) ? (array) $patterns : array(
    $patterns,
  );
  foreach ($patterns as $pattern) {
    if (stripos($string, $pattern) > -1) {
      return true;
    }
  }
}