mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
chore: use str_contains (#3841)
This commit is contained in:
@@ -47,7 +47,7 @@ class UnparsePostMentions
|
|||||||
$attributes['displayname'] = $this->translator->trans('core.lib.username.deleted_text');
|
$attributes['displayname'] = $this->translator->trans('core.lib.username.deleted_text');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($attributes['displayname'], '"#') !== false) {
|
if (str_contains($attributes['displayname'], '"#')) {
|
||||||
$attributes['displayname'] = preg_replace('/"#[a-z]{0,3}[0-9]+/', '_', $attributes['displayname']);
|
$attributes['displayname'] = preg_replace('/"#[a-z]{0,3}[0-9]+/', '_', $attributes['displayname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class UnparsePostMentions
|
|||||||
{
|
{
|
||||||
$tagName = 'POSTMENTION';
|
$tagName = 'POSTMENTION';
|
||||||
|
|
||||||
if (strpos($xml, $tagName) === false) {
|
if (! str_contains($xml, $tagName)) {
|
||||||
return $xml;
|
return $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ class UnparseTagMentions
|
|||||||
{
|
{
|
||||||
$tagName = 'TAGMENTION';
|
$tagName = 'TAGMENTION';
|
||||||
|
|
||||||
if (strpos($xml, $tagName) === false) {
|
if (! str_contains($xml, $tagName)) {
|
||||||
return $xml;
|
return $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ class UnparseUserMentions
|
|||||||
|
|
||||||
$attributes['displayname'] = $user?->display_name ?? $this->translator->trans('core.lib.username.deleted_text');
|
$attributes['displayname'] = $user?->display_name ?? $this->translator->trans('core.lib.username.deleted_text');
|
||||||
|
|
||||||
if (strpos($attributes['displayname'], '"#') !== false) {
|
if (str_contains($attributes['displayname'], '"#')) {
|
||||||
$attributes['displayname'] = preg_replace('/"#[a-z]{0,3}[0-9]+/', '_', $attributes['displayname']);
|
$attributes['displayname'] = preg_replace('/"#[a-z]{0,3}[0-9]+/', '_', $attributes['displayname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ class UnparseUserMentions
|
|||||||
{
|
{
|
||||||
$tagName = 'USERMENTION';
|
$tagName = 'USERMENTION';
|
||||||
|
|
||||||
if (strpos($xml, $tagName) === false) {
|
if (! str_contains($xml, $tagName)) {
|
||||||
return $xml;
|
return $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ class RequireExtensionHandler
|
|||||||
$packageName = $command->package;
|
$packageName = $command->package;
|
||||||
|
|
||||||
// Auto append :* if not requiring a specific version.
|
// Auto append :* if not requiring a specific version.
|
||||||
if (strpos($packageName, ':') === false) {
|
if (! str_contains($packageName, ':')) {
|
||||||
$packageName .= ':*';
|
$packageName .= ':*';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user