Replace preg_match by stripos

The preg_match should be replaced with stripos like mentioned in the php docs (http://php.net/manual/en/function.preg-match.php#refsect1-function.preg-match-notes)

Also preg_match could cause issues with namespaces.