mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 01:41:39 +08:00
chore: use str_contains (#3841)
This commit is contained in:
parent
ee34217b15
commit
be9eb16d7d
@ -47,7 +47,7 @@ class UnparsePostMentions
|
||||
$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']);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ class UnparsePostMentions
|
||||
{
|
||||
$tagName = 'POSTMENTION';
|
||||
|
||||
if (strpos($xml, $tagName) === false) {
|
||||
if (! str_contains($xml, $tagName)) {
|
||||
return $xml;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ class UnparseTagMentions
|
||||
{
|
||||
$tagName = 'TAGMENTION';
|
||||
|
||||
if (strpos($xml, $tagName) === false) {
|
||||
if (! str_contains($xml, $tagName)) {
|
||||
return $xml;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class UnparseUserMentions
|
||||
|
||||
$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']);
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class UnparseUserMentions
|
||||
{
|
||||
$tagName = 'USERMENTION';
|
||||
|
||||
if (strpos($xml, $tagName) === false) {
|
||||
if (! str_contains($xml, $tagName)) {
|
||||
return $xml;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ class RequireExtensionHandler
|
||||
$packageName = $command->package;
|
||||
|
||||
// Auto append :* if not requiring a specific version.
|
||||
if (strpos($packageName, ':') === false) {
|
||||
if (! str_contains($packageName, ':')) {
|
||||
$packageName .= ':*';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user