mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/15540] Add types
PHPBB3-15540
This commit is contained in:
@@ -283,6 +283,7 @@ class acp_search
|
||||
case 'delete':
|
||||
try
|
||||
{
|
||||
$this->state[2] = $this->state[2] ?? 0;
|
||||
if ($status = $this->search->delete_index($this->state[2])) // Status is not null, so deleting is in progress....
|
||||
{
|
||||
// save the current state
|
||||
@@ -312,6 +313,7 @@ class acp_search
|
||||
case 'create':
|
||||
try
|
||||
{
|
||||
$this->state[2] = $this->state[2] ?? 0;
|
||||
if ($status = $this->search->create_index($this->state[2])) // Status is not null, so indexing is in progress....
|
||||
{
|
||||
// save the current state
|
||||
|
@@ -1634,7 +1634,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
|
||||
// Collect some basic information about which tables and which rows to update/insert
|
||||
$sql_data = array();
|
||||
$poster_id = ($mode == 'edit') ? $data_ary['poster_id'] : (int) $user->data['user_id'];
|
||||
$poster_id = ($mode == 'edit') ? (int) $data_ary['poster_id'] : (int) $user->data['user_id'];
|
||||
|
||||
// Retrieve some additional information if not present
|
||||
if ($mode == 'edit' && (!isset($data_ary['post_visibility']) || !isset($data_ary['topic_visibility']) || $data_ary['post_visibility'] === false || $data_ary['topic_visibility'] === false))
|
||||
@@ -2215,7 +2215,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'";
|
||||
|
||||
// Maybe not only the subject, but also changing anonymous usernames. ;)
|
||||
if ($data_ary['poster_id'] == ANONYMOUS)
|
||||
if ((int) $data_ary['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
@@ -2232,7 +2232,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// this post is the latest post in the forum, better update
|
||||
if ($row['forum_last_post_id'] == $data_ary['post_id'] && ($row['forum_last_post_subject'] !== $subject || $data_ary['poster_id'] == ANONYMOUS))
|
||||
if ($row['forum_last_post_id'] == $data_ary['post_id'] && ($row['forum_last_post_subject'] !== $subject || (int) $data_ary['poster_id'] == ANONYMOUS))
|
||||
{
|
||||
// the post's subject changed
|
||||
if ($row['forum_last_post_subject'] !== $subject)
|
||||
@@ -2241,7 +2241,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
}
|
||||
|
||||
// Update the user name if poster is anonymous... just in case a moderator changed it
|
||||
if ($data_ary['poster_id'] == ANONYMOUS)
|
||||
if ((int) $data_ary['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
@@ -2308,11 +2308,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
}
|
||||
}
|
||||
|
||||
$search->index($mode, $data_ary['post_id'], $data_ary['message'], $subject, $poster_id, $data_ary['forum_id']);
|
||||
$search->index($mode, (int) $data_ary['post_id'], $data_ary['message'], $subject, $poster_id, (int) $data_ary['forum_id']);
|
||||
}
|
||||
|
||||
// Topic Notification, do not change if moderator is changing other users posts...
|
||||
if ($user->data['user_id'] == $poster_id)
|
||||
if ((int) $user->data['user_id'] == $poster_id)
|
||||
{
|
||||
if (!$data_ary['notify_set'] && $data_ary['notify'])
|
||||
{
|
||||
|
@@ -1566,7 +1566,7 @@ function mcp_fork_topic($topic_ids)
|
||||
}
|
||||
}
|
||||
$db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
|
||||
$new_post_id = $db->sql_nextid();
|
||||
$new_post_id = (int) $db->sql_nextid();
|
||||
|
||||
/**
|
||||
* Perform actions after forked topic is created.
|
||||
@@ -1605,7 +1605,7 @@ function mcp_fork_topic($topic_ids)
|
||||
|
||||
if (!empty($search))
|
||||
{
|
||||
$search->index($search_mode, $new_post_id, $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);
|
||||
$search->index($search_mode, $new_post_id, $sql_ary['post_text'], $sql_ary['post_subject'], (int) $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);
|
||||
$search_mode = 'reply'; // After one we index replies
|
||||
}
|
||||
|
||||
|
@@ -642,7 +642,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
|
||||
}
|
||||
}
|
||||
|
||||
$search->index('edit', $first_post_data['post_id'], $first_post_data['post_text'], $subject, $first_post_data['poster_id'], $first_post_data['forum_id']);
|
||||
$search->index('edit', (int) $first_post_data['post_id'], $first_post_data['post_text'], $subject, (int) $first_post_data['poster_id'], (int) $first_post_data['forum_id']);
|
||||
}
|
||||
|
||||
// Copy topic subscriptions to new topic
|
||||
|
Reference in New Issue
Block a user