mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
Type casting can be used
Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
parent
742575bb56
commit
b08f6e898b
7 changed files with 14 additions and 14 deletions
|
@ -313,7 +313,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
|
||||
$where_sql = '';
|
||||
$where_sql .= ($ip_in_sql != '') ? "poster_ip IN ($ip_in_sql)" : '';
|
||||
$where_sql .= ($ip_like_sql != '') ? ($where_sql != '') ? " OR $ip_like_sql" : "$ip_like_sql" : '';
|
||||
$where_sql .= ($ip_like_sql != '') ? ($where_sql != '') ? " OR $ip_like_sql" : (string)$ip_like_sql : '';
|
||||
|
||||
if (!$where_sql) {
|
||||
bb_die('invalid request');
|
||||
|
|
|
@ -384,7 +384,7 @@ if ($tor_reged && $tor_info) {
|
|||
define('SEEDER_EXIST', true);
|
||||
$seed_order_action = "viewtopic.php?" . POST_TOPIC_URL . "=$bt_topic_id&spmode=full#seeders";
|
||||
|
||||
$template->assign_block_vars("$x_full", array(
|
||||
$template->assign_block_vars((string)$x_full, array(
|
||||
'SEED_ORD_ACT' => $seed_order_action,
|
||||
'SEEDERS_UP_TOT' => humn_size($sp_up_tot[$x], 0, 'KB') . '/s'
|
||||
));
|
||||
|
@ -406,7 +406,7 @@ if ($tor_reged && $tor_info) {
|
|||
define('LEECHER_EXIST', true);
|
||||
$leech_order_action = "viewtopic.php?" . POST_TOPIC_URL . "=$bt_topic_id&spmode=full#leechers";
|
||||
|
||||
$template->assign_block_vars("$x_full", array(
|
||||
$template->assign_block_vars((string)$x_full, array(
|
||||
'LEECH_ORD_ACT' => $leech_order_action,
|
||||
'LEECHERS_UP_TOT' => humn_size($sp_up_tot[$x], 0, 'KB') . '/s',
|
||||
'LEECHERS_DOWN_TOT' => humn_size($sp_down_tot[$x], 0, 'KB') . '/s'
|
||||
|
|
|
@ -200,7 +200,7 @@ function strip_quotes($text)
|
|||
do {
|
||||
$pos = strpos($lowertext, '[quote', $curpos);
|
||||
if ($pos !== false) {
|
||||
$start_pos["$pos"] = 'start';
|
||||
$start_pos[(string)$pos] = 'start';
|
||||
$curpos = $pos + 6;
|
||||
}
|
||||
} while ($pos !== false);
|
||||
|
@ -215,7 +215,7 @@ function strip_quotes($text)
|
|||
do {
|
||||
$pos = strpos($lowertext, '[/quote', $curpos);
|
||||
if ($pos !== false) {
|
||||
$end_pos["$pos"] = 'end';
|
||||
$end_pos[(string)$pos] = 'end';
|
||||
$curpos = $pos + 8;
|
||||
}
|
||||
} while ($pos !== false);
|
||||
|
@ -259,7 +259,7 @@ function strip_quotes($text)
|
|||
// recursion.
|
||||
if ($stack) {
|
||||
foreach ($stack as $pos) {
|
||||
unset($pos_list["$pos"]);
|
||||
unset($pos_list[(string)$pos]);
|
||||
}
|
||||
}
|
||||
} while ($stack);
|
||||
|
|
|
@ -517,7 +517,7 @@ if ($post_mode) {
|
|||
|
||||
$SQL['GROUP BY'][] = "item_id";
|
||||
$SQL['ORDER BY'][] = ($new_posts && $join_p) ? "p.topic_id ASC, p.post_time ASC" : "$order $sort";
|
||||
$SQL['LIMIT'][] = "$search_limit";
|
||||
$SQL['LIMIT'][] = (string)$search_limit;
|
||||
|
||||
$items_display = fetch_search_ids($SQL);
|
||||
} elseif (!$items_display = array_slice($items_found, $start, $per_page)) {
|
||||
|
@ -726,7 +726,7 @@ else {
|
|||
}
|
||||
|
||||
$SQL['GROUP BY'][] = "item_id";
|
||||
$SQL['LIMIT'][] = "$search_limit";
|
||||
$SQL['LIMIT'][] = (string)$search_limit;
|
||||
|
||||
if ($egosearch) {
|
||||
$SQL['ORDER BY'][] = 'max_post_time DESC';
|
||||
|
@ -767,7 +767,7 @@ else {
|
|||
$SQL['WHERE'][] = "t.forum_id NOT IN($excluded_forums_csv)";
|
||||
}
|
||||
|
||||
$SQL['LIMIT'][] = "$per_page";
|
||||
$SQL['LIMIT'][] = (string)$per_page;
|
||||
|
||||
// Fetch topics data
|
||||
$topic_rows = array();
|
||||
|
|
|
@ -70,7 +70,7 @@ class LogAction
|
|||
}
|
||||
|
||||
$sql_ary = [
|
||||
'log_type_id' => (int)$this->log_type["$type_name"],
|
||||
'log_type_id' => (int)$this->log_type[(string)$type_name],
|
||||
'log_user_id' => (int)$user_id,
|
||||
'log_user_ip' => (string)$session_ip,
|
||||
'log_forum_id' => (int)$forum_id,
|
||||
|
|
|
@ -392,7 +392,7 @@ class SqlDb
|
|||
case is_string($v):
|
||||
return "'" . $this->escape_string($v) . "'";
|
||||
case is_int($v):
|
||||
return "$v";
|
||||
return (string)$v;
|
||||
case is_bool($v):
|
||||
return ($v) ? '1' : '0';
|
||||
case is_float($v):
|
||||
|
@ -733,7 +733,7 @@ class SqlDb
|
|||
}
|
||||
|
||||
if ($this->link and $ext = mysqli_info($this->link)) {
|
||||
$info[] = "$ext";
|
||||
$info[] = (string)$ext;
|
||||
} elseif (!$num && ($aff = $this->affected_rows($this->result) and $aff != -1)) {
|
||||
$info[] = "$aff rows";
|
||||
}
|
||||
|
|
|
@ -864,9 +864,9 @@ class Template
|
|||
} elseif (!empty($m[4])) {
|
||||
$token = ($tokens_cnt == 1) ? "!empty(\$V['{$m[4]}'])" : "\$V['{$m[4]}']";
|
||||
} elseif (!empty($m[5])) {
|
||||
$token = ($tokens_cnt == 1) ? "!empty({$m[5]})" : "{$m[5]}";
|
||||
$token = ($tokens_cnt == 1) ? "!empty({$m[5]})" : (string)($m[5]);
|
||||
} elseif (!empty($m[7])) {
|
||||
$token = ($tokens_cnt == 1) ? "defined('{$m[7]}') && {$m[7]}" : "{$m[7]}";
|
||||
$token = ($tokens_cnt == 1) ? "defined('{$m[7]}') && {$m[7]}" : (string)($m[7]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue