mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
chore: fix php 8.1 on preg_match 2nd argument being null, which also optimizes slightly
This commit is contained in:
@@ -38,7 +38,7 @@ abstract class AbstractRegexGambit implements GambitInterface
|
||||
*/
|
||||
protected function match($bit)
|
||||
{
|
||||
if (preg_match('/^(-?)'.$this->getGambitPattern().'$/i', $bit, $matches)) {
|
||||
if (! empty($bit) && preg_match('/^(-?)'.$this->getGambitPattern().'$/i', $bit, $matches)) {
|
||||
return $matches;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user