mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Replaced strpos() with simplified realization (#1172)
This commit is contained in:
parent
bb20d523b0
commit
493cd910cf
13 changed files with 24 additions and 24 deletions
|
@ -382,7 +382,7 @@ function attachment_sync_topic($topics)
|
|||
*/
|
||||
function get_extension($filename)
|
||||
{
|
||||
if (false === strpos($filename, '.')) {
|
||||
if (!str_contains($filename, '.')) {
|
||||
return '';
|
||||
}
|
||||
$extension = strrchr(strtolower($filename), '.');
|
||||
|
|
|
@ -26,9 +26,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
|||
$post_id_array = [];
|
||||
|
||||
if (!is_array($attach_id_array)) {
|
||||
if (false !== strpos($attach_id_array, ', ')) {
|
||||
if (str_contains($attach_id_array, ', ')) {
|
||||
$attach_id_array = explode(', ', $attach_id_array);
|
||||
} elseif (false !== strpos($attach_id_array, ',')) {
|
||||
} elseif (str_contains($attach_id_array, ',')) {
|
||||
$attach_id_array = explode(',', $attach_id_array);
|
||||
} else {
|
||||
$attach_id = (int)$attach_id_array;
|
||||
|
@ -67,9 +67,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
|||
return;
|
||||
}
|
||||
|
||||
if (false !== strpos($post_id_array, ', ')) {
|
||||
if (str_contains($post_id_array, ', ')) {
|
||||
$post_id_array = explode(', ', $post_id_array);
|
||||
} elseif (false !== strpos($post_id_array, ',')) {
|
||||
} elseif (str_contains($post_id_array, ',')) {
|
||||
$post_id_array = explode(',', $post_id_array);
|
||||
} else {
|
||||
$post_id = (int)$post_id_array;
|
||||
|
@ -112,9 +112,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
|||
}
|
||||
|
||||
if (!is_array($attach_id_array)) {
|
||||
if (false !== strpos($attach_id_array, ', ')) {
|
||||
if (str_contains($attach_id_array, ', ')) {
|
||||
$attach_id_array = explode(', ', $attach_id_array);
|
||||
} elseif (false !== strpos($attach_id_array, ',')) {
|
||||
} elseif (str_contains($attach_id_array, ',')) {
|
||||
$attach_id_array = explode(',', $attach_id_array);
|
||||
} else {
|
||||
$attach_id = (int)$attach_id_array;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue