This commit is contained in:
Roman Kelesidis 2025-03-01 21:11:18 +03:00
commit 22db50889c
4 changed files with 11 additions and 11 deletions

View file

@ -89,7 +89,7 @@ class Atom
} }
$topics[] = $topic; $topics[] = $topic;
} }
if (!\count($topics)) { if (!count($topics)) {
@unlink($file_path); @unlink($file_path);
return false; return false;
} }
@ -145,7 +145,7 @@ class Atom
} }
$topics[] = $topic; $topics[] = $topic;
} }
if (!\count($topics)) { if (!count($topics)) {
@unlink($file_path); @unlink($file_path);
return false; return false;
} }

View file

@ -266,7 +266,7 @@ class Attach
} }
} }
$this->num_attachments = is_countable($this->attachment_list) ? \count($this->attachment_list) : 0; $this->num_attachments = is_countable($this->attachment_list) ? count($this->attachment_list) : 0;
if ($submit) { if ($submit) {
if ($mode === 'newtopic' || $mode === 'reply' || $mode === 'editpost') { if ($mode === 'newtopic' || $mode === 'reply' || $mode === 'editpost') {
@ -334,7 +334,7 @@ class Attach
// restore values :) // restore values :)
if (isset($_POST['attachment_list'])) { if (isset($_POST['attachment_list'])) {
for ($i = 0, $iMax = is_countable($actual_list) ? \count($actual_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($actual_list) ? count($actual_list) : 0; $i < $iMax; $i++) {
$restore = false; $restore = false;
$del_thumb = false; $del_thumb = false;
@ -402,7 +402,7 @@ class Attach
$this->attachment_comment_list = []; $this->attachment_comment_list = [];
for ($i = 0, $iMax = is_countable($this->attachment_list) ? \count($this->attachment_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($this->attachment_list) ? count($this->attachment_list) : 0; $i < $iMax; $i++) {
$this->attachment_comment_list[$i] = $actual_comment_list[$i]; $this->attachment_comment_list[$i] = $actual_comment_list[$i];
} }
} }
@ -424,7 +424,7 @@ class Attach
$attachment_id = 0; $attachment_id = 0;
$actual_element = 0; $actual_element = 0;
for ($i = 0, $iMax = is_countable($actual_id_list) ? \count($actual_id_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($actual_id_list) ? count($actual_id_list) : 0; $i < $iMax; $i++) {
if (isset($_POST['update_attachment'][$actual_id_list[$i]])) { if (isset($_POST['update_attachment'][$actual_id_list[$i]])) {
$attachment_id = (int)$actual_id_list[$i]; $attachment_id = (int)$actual_id_list[$i];
$actual_element = $i; $actual_element = $i;
@ -551,7 +551,7 @@ class Attach
} }
if ($mode === 'attach_list') { if ($mode === 'attach_list') {
for ($i = 0, $iMax = is_countable($this->attachment_list) ? \count($this->attachment_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($this->attachment_list) ? count($this->attachment_list) : 0; $i < $iMax; $i++) {
if ($this->attachment_id_list[$i]) { if ($this->attachment_id_list[$i]) {
//bt //bt
if ($this->attachment_extension_list[$i] === TORRENT_EXT && !\defined('TORRENT_ATTACH_ID')) { if ($this->attachment_extension_list[$i] === TORRENT_EXT && !\defined('TORRENT_ATTACH_ID')) {
@ -678,7 +678,7 @@ class Attach
if ($this->attachment_list) { if ($this->attachment_list) {
$hidden = ''; $hidden = '';
for ($i = 0, $iMax = is_countable($this->attachment_list) ? \count($this->attachment_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($this->attachment_list) ? count($this->attachment_list) : 0; $i < $iMax; $i++) {
$hidden .= '<input type="hidden" name="attachment_list[]" value="' . $this->attachment_list[$i] . '" />'; $hidden .= '<input type="hidden" name="attachment_list[]" value="' . $this->attachment_list[$i] . '" />';
$hidden .= '<input type="hidden" name="filename_list[]" value="' . $this->attachment_filename_list[$i] . '" />'; $hidden .= '<input type="hidden" name="filename_list[]" value="' . $this->attachment_filename_list[$i] . '" />';
$hidden .= '<input type="hidden" name="extension_list[]" value="' . $this->attachment_extension_list[$i] . '" />'; $hidden .= '<input type="hidden" name="extension_list[]" value="' . $this->attachment_extension_list[$i] . '" />';
@ -710,7 +710,7 @@ class Attach
'TPL_POSTED_ATTACHMENTS' => true, 'TPL_POSTED_ATTACHMENTS' => true,
]); ]);
for ($i = 0, $iMax = is_countable($this->attachment_list) ? \count($this->attachment_list) : 0; $i < $iMax; $i++) { for ($i = 0, $iMax = is_countable($this->attachment_list) ? count($this->attachment_list) : 0; $i < $iMax; $i++) {
if (@$this->attachment_id_list[$i] == 0) { if (@$this->attachment_id_list[$i] == 0) {
$download_link = $upload_dir . '/' . basename($this->attachment_list[$i]); $download_link = $upload_dir . '/' . basename($this->attachment_list[$i]);
} else { } else {

View file

@ -38,7 +38,7 @@ class AttachPosting extends Attach
$this->do_insert_attachment('attach_list', 'post', $post_id); $this->do_insert_attachment('attach_list', 'post', $post_id);
$this->do_insert_attachment('last_attachment', 'post', $post_id); $this->do_insert_attachment('last_attachment', 'post', $post_id);
if (((is_countable($this->attachment_list) ? \count($this->attachment_list) : 0) > 0 || $this->post_attach) && !isset($_POST['update_attachment'])) { if (((is_countable($this->attachment_list) ? count($this->attachment_list) : 0) > 0 || $this->post_attach) && !isset($_POST['update_attachment'])) {
$sql = 'UPDATE ' . BB_POSTS . ' SET post_attachment = 1 WHERE post_id = ' . (int)$post_id; $sql = 'UPDATE ' . BB_POSTS . ' SET post_attachment = 1 WHERE post_id = ' . (int)$post_id;
if (!DB()->sql_query($sql)) { if (!DB()->sql_query($sql)) {

View file

@ -51,7 +51,7 @@ class Poll
} }
// check for "< 3" -- 2 answer variants + header // check for "< 3" -- 2 answer variants + header
if (\count($this->poll_votes) < 3 || \count($this->poll_votes) > $this->max_votes + 1) { if (count($this->poll_votes) < 3 || count($this->poll_votes) > $this->max_votes + 1) {
global $lang; global $lang;
return $this->err_msg = sprintf($lang['NEW_POLL_VOTES'], $this->max_votes); return $this->err_msg = sprintf($lang['NEW_POLL_VOTES'], $this->max_votes);
} }