StrContains

pull/7361/head
Your Name 6 days ago
parent dc7cf910fa
commit 9e052883bf

@ -882,12 +882,12 @@ trait AdminSettingsController
$visibility = $request->input('disk_config.visibility');
$url = $request->input('disk_config.url');
$endpoint = $request->input('disk_config.endpoint');
if (strpos($key, '*') === false && $key != config_cache($dkey.'key')) {
if (!str_contains($key, '*') && $key != config_cache($dkey.'key')) {
array_push($changes, 'key');
} else {
$ckey = config_cache($dkey.'key');
}
if (strpos($secret, '*') === false && $secret != config_cache($dkey.'secret')) {
if (!str_contains($secret, '*') && $secret != config_cache($dkey.'secret')) {
array_push($changes, 'secret');
} else {
$csecret = config_cache($dkey.'secret');

@ -3518,7 +3518,7 @@ class ApiV1Controller extends Controller
if (
isset($status['account']['acct']) &&
strpos($status['account']['acct'], '@') !== false
str_contains($status['account']['acct'], '@')
) {
$domain = parse_url(
$status['account']['url'],

@ -113,7 +113,7 @@ class FederationController extends Controller
if ($cached = Cache::get($key)) {
return response()->json($cached, 200, [], JSON_UNESCAPED_SLASHES);
}
if (strpos($resource, $domain) == false) {
if (!str_contains($resource, $domain)) {
return response('', 400);
}
$parsed = Nickname::normalizeProfileUrl($resource);

@ -192,7 +192,7 @@ class InstallController extends Controller
protected function updateConfig($key, $value): void
{
$f = file_get_contents(base_path('.env'));
if (strpos($f, $key) !== false) {
if (str_contains($f, $key)) {
$u = str_replace($key, $value, $f);
} else {
$u = $f;

@ -74,7 +74,7 @@ class ImportService
}
throw $e;
} catch (\Exception $e) {
if (strpos($e->getMessage(), 'Could not find valid next date') !== false) {
if (str_contains($e->getMessage(), 'Could not find valid next date')) {
return null;
}
throw $e;
@ -169,7 +169,7 @@ class ImportService
throw $e;
} catch (\Exception $e) {
if (strpos($e->getMessage(), 'Could not find valid next date') !== false) {
if (str_contains($e->getMessage(), 'Could not find valid next date')) {
return null;
}
throw $e;

@ -236,14 +236,14 @@ class SearchApiV2Service
return $this->resolveLocalProfile();
}
} else {
if (! Helpers::validateUrl($query) && strpos($query, '@') === false) {
if (! Helpers::validateUrl($query) && !str_contains($query, '@')) {
return $default;
}
if (
! Str::startsWith($query, 'http') &&
Str::substrCount($query, '@') == 1 &&
strpos($query, '@') !== false &&
str_contains($query, '@') &&
strpos($query, '@') !== 0
) {
try {

@ -332,7 +332,7 @@ class Extractor extends Regex
}
$needle = $this->extractURLWithoutProtocol() ? '.' : ':';
if (strpos($tweet, $needle) === false) {
if (!str_contains($tweet, $needle)) {
return [];
}

@ -114,7 +114,7 @@ class HitHighlighter extends Regex
$highlightTweet = '';
$tags = ['<'.$this->tag.'>', '</'.$this->tag.'>'];
// Check whether we can simply replace or whether we need to chunk...
if (strpos($tweet, '<') === false) {
if (!str_contains($tweet, '<')) {
$ti = 0; // tag increment (for added tags)
$highlightTweet = $tweet;
foreach ($hits as $hit) {

Loading…
Cancel
Save