mirror of
https://github.com/flarum/core.git
synced 2025-08-02 06:30:53 +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)
|
protected function match($bit)
|
||||||
{
|
{
|
||||||
if (preg_match('/^(-?)'.$this->getGambitPattern().'$/i', $bit, $matches)) {
|
if (! empty($bit) && preg_match('/^(-?)'.$this->getGambitPattern().'$/i', $bit, $matches)) {
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user