Replaced strpos() with simplified realization (#1172)

This commit is contained in:
Roman Kelesidis 2023-11-27 20:12:13 +03:00 committed by GitHub
commit 493cd910cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 24 additions and 24 deletions

View file

@ -255,7 +255,7 @@ if (!isset($_REQUEST['dosearch'])) {
$username = str_replace("\*", '%', trim(strip_tags(strtolower($username))));
if (false !== strpos($username, '%')) {
if (str_contains($username, '%')) {
$op = 'LIKE';
} else {
$op = '=';
@ -276,7 +276,7 @@ if (!isset($_REQUEST['dosearch'])) {
$email = str_replace("\*", '%', trim(strip_tags(strtolower($email))));
if (false !== strpos($email, '%')) {
if (str_contains($email, '%')) {
$op = 'LIKE';
} else {
$op = '=';
@ -524,7 +524,7 @@ if (!isset($_REQUEST['dosearch'])) {
break;
case 'equals':
// looking for a -
if (false !== strpos($postcount_value, '-')) {
if (str_contains($postcount_value, '-')) {
$range = preg_split('/[-\s]+/', $postcount_value);
$range_begin = (int)$range[0];
@ -571,7 +571,7 @@ if (!isset($_REQUEST['dosearch'])) {
$userfield_value = str_replace("\*", '%', trim(strip_tags(strtolower($userfield_value))));
if (false !== strpos($userfield_value, '%')) {
if (str_contains($userfield_value, '%')) {
$op = 'LIKE';
} else {
$op = '=';