+
' . $dbg['src'] . ' [' . sprintf('%.4f', $dbg['time']) . ' s] ' . $dbg['info'] . ' |
' . "$this->db_server.$this->selected_db" . ' :: Query #' . ($this->num_queries + 1) . ' |
' . $this->explain_hold . ' |
- ' . short_query($dbg['sql'], true) . '
+ ' . short_query($dbg['sql'], true) . '
';
break;
diff --git a/library/includes/cron/cron_run.php b/library/includes/cron/cron_run.php
index fd5879caa..ff3e718e6 100644
--- a/library/includes/cron/cron_run.php
+++ b/library/includes/cron/cron_run.php
@@ -73,7 +73,7 @@ foreach ($cron_jobs as $job) {
$msg[] = sprintf('%-4s', round(sys('la'), 1));
$msg[] = sprintf('%05d', getmypid());
$msg[] = $job['cron_title'];
- $msg = join(LOG_SEPR, $msg);
+ $msg = implode(LOG_SEPR, $msg);
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
}
@@ -97,12 +97,12 @@ foreach ($cron_jobs as $job) {
$msg[] = sprintf('%-4s', round(sys('la'), 1));
$msg[] = sprintf('%05d', getmypid());
$msg[] = round(utime() - $cron_start_time) . '/' . round(utime() - TIMESTART) . ' sec';
- $msg = join(LOG_SEPR, $msg);
+ $msg = implode(LOG_SEPR, $msg);
$msg .= LOG_LF . '------=-------=----------=------=-------=----------';
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
if ($cron_runtime_log) {
- $runtime_log_file = ($job['log_file']) ? $job['log_file'] : $job['cron_script'];
+ $runtime_log_file = ($job['log_file']) ?: $job['cron_script'];
bb_log($cron_runtime_log . LOG_LF, CRON_LOG_DIR . '/' . basename($runtime_log_file));
}
}
diff --git a/library/includes/cron/jobs/attach_maintenance.php b/library/includes/cron/jobs/attach_maintenance.php
index e9979a368..748c83fdb 100644
--- a/library/includes/cron/jobs/attach_maintenance.php
+++ b/library/includes/cron/jobs/attach_maintenance.php
@@ -66,13 +66,13 @@ if ($dir = @opendir($attach_dir)) {
$f_len += strlen($f) + 5;
if ($f_len > $db_max_packet) {
- $files = join(',', $files);
+ $files = implode(',', $files);
DB()->query("INSERT INTO $tmp_attach_tbl VALUES $files");
$files = array();
$f_len = 0;
}
}
- if ($files = join(',', $files)) {
+ if ($files = implode(',', $files)) {
DB()->query("INSERT INTO $tmp_attach_tbl VALUES $files");
}
closedir($dir);
@@ -154,7 +154,7 @@ if ($check_attachments) {
$orphan_db_attach[] = $row['attach_id'];
}
// Delete all orphan attachments
- if ($orphans_sql = join(',', $orphan_db_attach)) {
+ if ($orphans_sql = implode(',', $orphan_db_attach)) {
if ($fix_errors) {
DB()->query("DELETE FROM " . BB_ATTACHMENTS_DESC . " WHERE attach_id IN($orphans_sql)");
DB()->query("DELETE FROM " . BB_ATTACHMENTS . " WHERE attach_id IN($orphans_sql)");
@@ -172,7 +172,7 @@ if ($check_attachments) {
$orphan_tor[] = $row['topic_id'];
}
// Delete all orphan torrents
- if ($orphans_sql = join(',', $orphan_tor)) {
+ if ($orphans_sql = implode(',', $orphan_tor)) {
if ($fix_errors) {
DB()->query("DELETE FROM " . BB_BT_TORRENTS . " WHERE topic_id IN($orphans_sql)");
}
@@ -188,7 +188,7 @@ if ($check_attachments) {
foreach (DB()->fetch_rowset($sql) as $row) {
$posts_without_attach[] = $row['post_id'];
}
- if ($posts_sql = join(',', $posts_without_attach)) {
+ if ($posts_sql = implode(',', $posts_without_attach)) {
if ($fix_errors) {
DB()->query("UPDATE " . BB_POSTS . " SET post_attachment = 0 WHERE post_id IN($posts_sql)");
}
@@ -204,7 +204,7 @@ if ($check_attachments) {
foreach (DB()->fetch_rowset($sql) as $row) {
$topics_without_attach[] = $row['topic_id'];
}
- if ($topics_sql = join(',', $topics_without_attach)) {
+ if ($topics_sql = implode(',', $topics_without_attach)) {
if ($fix_errors) {
DB()->query("UPDATE " . BB_TOPICS . " SET topic_attachment = 0 WHERE topic_id IN($topics_sql)");
}
diff --git a/library/includes/cron/jobs/board_maintenance.php b/library/includes/cron/jobs/board_maintenance.php
index 2a495f804..1221c3219 100644
--- a/library/includes/cron/jobs/board_maintenance.php
+++ b/library/includes/cron/jobs/board_maintenance.php
@@ -64,6 +64,6 @@ if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
DB()->query("UPDATE " . BB_USERS . " SET user_newpasswd = '' WHERE user_lastvisit < " . (TIMENOW - 7 * 86400));
// Чистка кеша постов
-if ($posts_days = intval($bb_cfg['posts_cache_days_keep'])) {
+if ($posts_days = (int)$bb_cfg['posts_cache_days_keep']) {
DB()->query("DELETE FROM " . BB_POSTS_HTML . " WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)");
}
diff --git a/library/includes/cron/jobs/clean_dlstat.php b/library/includes/cron/jobs/clean_dlstat.php
index 6cb37c0b9..8b7701b02 100644
--- a/library/includes/cron/jobs/clean_dlstat.php
+++ b/library/includes/cron/jobs/clean_dlstat.php
@@ -47,7 +47,7 @@ foreach ($keeping_dlstat as $dl_status => $days_to_keep) {
}
}
-if ($delete_dlstat_sql = join(') OR (', $delete_dlstat_sql)) {
+if ($delete_dlstat_sql = implode(') OR (', $delete_dlstat_sql)) {
DB()->query("DELETE QUICK FROM " . BB_BT_DLSTATUS . " WHERE ($delete_dlstat_sql)");
}
@@ -67,7 +67,7 @@ DB()->query("
");
// Tor-Stats cleanup
-if ($torstat_days_keep = intval($bb_cfg['torstat_days_keep'])) {
+if ($torstat_days_keep = (int)$bb_cfg['torstat_days_keep']) {
DB()->query("DELETE QUICK FROM " . BB_BT_TORSTAT . " WHERE last_modified_torstat < DATE_SUB(NOW(), INTERVAL $torstat_days_keep DAY)");
}
diff --git a/library/includes/cron/jobs/prune_inactive_users.php b/library/includes/cron/jobs/prune_inactive_users.php
index f3c5d6379..eb6b92daf 100644
--- a/library/includes/cron/jobs/prune_inactive_users.php
+++ b/library/includes/cron/jobs/prune_inactive_users.php
@@ -36,7 +36,7 @@ while (true) {
$prune_users = $not_activated_users = $not_active_users = array();
- if ($not_activated_days = intval($bb_cfg['user_not_activated_days_keep'])) {
+ if ($not_activated_days = (int)$bb_cfg['user_not_activated_days_keep']) {
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
WHERE user_level = 0
AND user_lastvisit = 0
@@ -50,7 +50,7 @@ while (true) {
}
}
- if ($not_active_days = intval($bb_cfg['user_not_active_days_keep'])) {
+ if ($not_active_days = (int)$bb_cfg['user_not_active_days_keep']) {
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
WHERE user_level = 0
AND user_posts = 0
diff --git a/library/includes/cron/jobs/sessions_cleanup.php b/library/includes/cron/jobs/sessions_cleanup.php
index e67aff133..2424120e0 100644
--- a/library/includes/cron/jobs/sessions_cleanup.php
+++ b/library/includes/cron/jobs/sessions_cleanup.php
@@ -27,10 +27,10 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
-$user_session_expire_time = TIMENOW - intval($bb_cfg['user_session_duration']);
-$admin_session_expire_time = TIMENOW - intval($bb_cfg['admin_session_duration']);
+$user_session_expire_time = TIMENOW - (int)$bb_cfg['user_session_duration'];
+$admin_session_expire_time = TIMENOW - (int)$bb_cfg['admin_session_duration'];
-$user_session_gc_time = $user_session_expire_time - intval($bb_cfg['user_session_gc_ttl']);
+$user_session_gc_time = $user_session_expire_time - (int)$bb_cfg['user_session_gc_ttl'];
$admin_session_gc_time = $admin_session_expire_time;
// ############################ Tables LOCKED ################################
diff --git a/library/includes/cron/jobs/tr_cleanup_and_dlstat.php b/library/includes/cron/jobs/tr_cleanup_and_dlstat.php
index a261ea667..144106d73 100644
--- a/library/includes/cron/jobs/tr_cleanup_and_dlstat.php
+++ b/library/includes/cron/jobs/tr_cleanup_and_dlstat.php
@@ -81,8 +81,8 @@ DB()->query("
// Clean peers table
if ($tr_cfg['autoclean']) {
- $announce_interval = max(intval($bb_cfg['announce_interval']), 60);
- $expire_factor = max(floatval($tr_cfg['expire_factor']), 1);
+ $announce_interval = max((int)$bb_cfg['announce_interval'], 60);
+ $expire_factor = max((float)$tr_cfg['expire_factor'], 1);
$peer_expire_time = TIMENOW - floor($announce_interval * $expire_factor);
DB()->query("DELETE FROM " . BB_BT_TRACKER . " WHERE update_time < $peer_expire_time");
diff --git a/library/includes/cron/jobs/tr_maintenance.php b/library/includes/cron/jobs/tr_maintenance.php
index 9737f1255..f118d4ed2 100644
--- a/library/includes/cron/jobs/tr_maintenance.php
+++ b/library/includes/cron/jobs/tr_maintenance.php
@@ -47,8 +47,8 @@ foreach (DB()->fetch_rowset($sql) as $row) {
$topics_sql[] = $row['topic_id'];
$attach_sql[] = $row['attach_id'];
}
-$dead_tor_sql = join(',', $topics_sql);
-$attach_sql = join(',', $attach_sql);
+$dead_tor_sql = implode(',', $topics_sql);
+$attach_sql = implode(',', $attach_sql);
if ($dead_tor_sql && $attach_sql) {
// Delete torstat
diff --git a/library/includes/cron/jobs/tr_make_snapshot.php b/library/includes/cron/jobs/tr_make_snapshot.php
index 53cf02008..6f2824aa3 100644
--- a/library/includes/cron/jobs/tr_make_snapshot.php
+++ b/library/includes/cron/jobs/tr_make_snapshot.php
@@ -73,7 +73,7 @@ while (true) {
}
foreach (DB()->fetch_rowset($sql) as $row) {
- $val[] = join(',', $row);
+ $val[] = implode(',', $row);
}
if ($val) {
@@ -81,13 +81,13 @@ while (true) {
DB()->query("
REPLACE INTO " . NEW_BB_BT_TRACKER_SNAP . "
(topic_id, seeders, leechers, speed_up, speed_down)
- VALUES(" . join('),(', $val) . ")
+ VALUES(" . implode('),(', $val) . ")
");
} else {
DB()->query("
INSERT INTO " . BB_BT_TRACKER_SNAP . "
(topic_id, speed_up, speed_down)
- VALUES(" . join('),(', $val) . ")
+ VALUES(" . implode('),(', $val) . ")
ON DUPLICATE KEY UPDATE speed_up = VALUES(speed_up), speed_down = VALUES(speed_down)
");
}
@@ -179,7 +179,7 @@ if ($bb_cfg['torhelp_enabled']) {
$online_users_ary[] = $row['uid'];
}
- if ($online_users_csv = join(',', $online_users_ary)) {
+ if ($online_users_csv = implode(',', $online_users_ary)) {
DB()->query("
INSERT INTO " . NEW_BB_BT_TORHELP . " (user_id, topic_id_csv)
SELECT
diff --git a/library/includes/datastore/apc.php b/library/includes/datastore/apc.php
index b4053b59e..4ee1e0171 100644
--- a/library/includes/datastore/apc.php
+++ b/library/includes/datastore/apc.php
@@ -30,7 +30,7 @@ if (!defined('BB_ROOT')) {
class datastore_apc extends datastore_common
{
public $engine = 'APC';
- public $prefix = null;
+ public $prefix;
public function __construct($prefix = null)
{
diff --git a/library/includes/datastore/build_cat_forums.php b/library/includes/datastore/build_cat_forums.php
index 83ee0416c..b2d7b00f3 100644
--- a/library/includes/datastore/build_cat_forums.php
+++ b/library/includes/datastore/build_cat_forums.php
@@ -113,9 +113,9 @@ foreach (DB()->fetch_rowset($sql) as $row) {
$data['c'][$row['cat_id']]['forums'][] = $fid;
}
foreach ($data['not_auth_forums'] as $key => $val) {
- $data['not_auth_forums'][$key] = join(',', $val);
+ $data['not_auth_forums'][$key] = implode(',', $val);
}
-$data['tracker_forums'] = join(',', $data['tracker_forums']);
+$data['tracker_forums'] = implode(',', $data['tracker_forums']);
$this->store('cat_forums', $data);
diff --git a/library/includes/datastore/common.php b/library/includes/datastore/common.php
index 8626718fc..b2a8111b0 100644
--- a/library/includes/datastore/common.php
+++ b/library/includes/datastore/common.php
@@ -149,7 +149,7 @@ class datastore_common
public $dbg = array();
public $dbg_id = 0;
public $dbg_enabled = false;
- public $cur_query = null;
+ public $cur_query;
public function debug($mode, $cur_query = null)
{
diff --git a/library/includes/datastore/file.php b/library/includes/datastore/file.php
index 9941383f7..b8905b4e2 100644
--- a/library/includes/datastore/file.php
+++ b/library/includes/datastore/file.php
@@ -29,8 +29,8 @@ if (!defined('BB_ROOT')) {
class datastore_file extends datastore_common
{
- public $dir = null;
- public $prefix = null;
+ public $dir;
+ public $prefix;
public $engine = 'Filecache';
public function __construct($dir, $prefix = null)
diff --git a/library/includes/datastore/memcache.php b/library/includes/datastore/memcache.php
index b31e543f4..eba2fd6b9 100644
--- a/library/includes/datastore/memcache.php
+++ b/library/includes/datastore/memcache.php
@@ -29,11 +29,11 @@ if (!defined('BB_ROOT')) {
class datastore_memcache extends datastore_common
{
- public $cfg = null;
- public $memcache = null;
+ public $cfg;
+ public $memcache;
public $connected = false;
public $engine = 'Memcache';
- public $prefix = null;
+ public $prefix;
public function __construct($cfg, $prefix = null)
{
diff --git a/library/includes/datastore/redis.php b/library/includes/datastore/redis.php
index e218bf67f..b3c5256eb 100644
--- a/library/includes/datastore/redis.php
+++ b/library/includes/datastore/redis.php
@@ -29,9 +29,9 @@ if (!defined('BB_ROOT')) {
class datastore_redis extends datastore_common
{
- public $cfg = null;
- public $redis = null;
- public $prefix = null;
+ public $cfg;
+ public $redis;
+ public $prefix;
public $connected = false;
public $engine = 'Redis';
diff --git a/library/includes/datastore/sqlite.php b/library/includes/datastore/sqlite.php
index eb3a31fae..06fd90d59 100644
--- a/library/includes/datastore/sqlite.php
+++ b/library/includes/datastore/sqlite.php
@@ -30,8 +30,8 @@ if (!defined('BB_ROOT')) {
class datastore_sqlite extends datastore_common
{
public $engine = 'SQLite';
- public $db = null;
- public $prefix = null;
+ public $db;
+ public $prefix;
public $cfg = array(
'db_file_path' => '/path/to/datastore.db.sqlite',
'table_name' => 'datastore',
@@ -79,7 +79,7 @@ class datastore_sqlite extends datastore_common
$prefix_sql = SQLite3::escapeString($this->prefix);
array_deep($items, 'SQLite3::escapeString');
- $items_list = $prefix_sql . join("','$prefix_sql", $items);
+ $items_list = $prefix_sql . implode("','$prefix_sql", $items);
$rowset = $this->db->fetch_rowset("SELECT ds_title, ds_data FROM " . $this->cfg['table_name'] . " WHERE ds_title IN ('$items_list')");
diff --git a/library/includes/datastore/xcache.php b/library/includes/datastore/xcache.php
index a0ccb770d..fdb688eae 100644
--- a/library/includes/datastore/xcache.php
+++ b/library/includes/datastore/xcache.php
@@ -29,7 +29,7 @@ if (!defined('BB_ROOT')) {
class datastore_xcache extends datastore_common
{
- public $prefix = null;
+ public $prefix;
public $engine = 'XCache';
public function __construct($prefix = null)
diff --git a/library/includes/functions.php b/library/includes/functions.php
index 274e2032f..53ad385ec 100644
--- a/library/includes/functions.php
+++ b/library/includes/functions.php
@@ -72,7 +72,7 @@ function get_tracks($type)
trigger_error(__FUNCTION__ . ": invalid type '$type'", E_USER_ERROR);
}
$tracks = !empty($_COOKIE[$c_name]) ? @unserialize($_COOKIE[$c_name]) : false;
- return ($tracks) ? $tracks : array();
+ return ($tracks) ?: array();
}
function set_tracks($cookie_name, &$tracking_ary, $tracks = null, $val = TIMENOW)
@@ -348,7 +348,7 @@ function setbit(&$int, $bit_num, $on)
forum auth levels, this will prevent the auth function having to do its own
lookup
*/
-function auth($type, $forum_id, $ug_data, $f_access = array(), $group_perm = UG_PERM_BOTH)
+function auth($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH)
{
global $lang, $bf, $datastore;
@@ -583,7 +583,7 @@ class Date_Delta
break;
}
}
- return join(' ', $parts);
+ return implode(' ', $parts);
}
// returns the associative array with date deltas.
@@ -676,7 +676,7 @@ class html_common
{
public $options = '';
public $attr = array();
- public $cur_attr = null;
+ public $cur_attr;
public $max_length = HTML_SELECT_MAX_LENGTH;
public $selected = array();
@@ -838,12 +838,12 @@ function declension($int, $expressions, $format = '%1$s %2$s')
if (count($expressions) < 3) {
$expressions[2] = $expressions[1];
}
- $count = intval($int) % 100;
+ $count = (int)$int % 100;
if ($count >= 5 && $count <= 20) {
$result = $expressions['2'];
} else {
- $count = $count % 10;
+ $count %= 10;
if ($count == 1) {
$result = $expressions['0'];
} elseif ($count >= 2 && $count <= 4) {
@@ -870,10 +870,10 @@ function url_arg($url, $arg, $value, $amp = '&')
// заменяем параметр, если он существует
if (preg_match("/((\?|&|&)$arg=)[^&]*/s", $url, $m)) {
$cur = $m[0];
- $new = is_null($value) ? '' : $m[1] . urlencode($value);
+ $new = null === $value ? '' : $m[1] . urlencode($value);
$url = str_replace($cur, $new, $url);
} // добавляем параметр
- elseif (!is_null($value)) {
+ elseif (null !== $value) {
$div = (strpos($url, '?') !== false) ? $amp : '?';
$url = $url . $div . $arg . '=' . urlencode($value);
}
@@ -901,12 +901,12 @@ function humn_size($size, $rounder = null, $min = null, $space = ' ')
$rnd = $rounders[0];
if ($min == 'KB' && $size < 1024) {
- $size = $size / 1024;
+ $size /= 1024;
$ext = 'KB';
$rounder = 1;
} else {
for ($i = 1, $cnt = count($sizes); ($i < $cnt && $size >= 1024); $i++) {
- $size = $size / 1024;
+ $size /= 1024;
$ext = $sizes[$i];
$rnd = $rounders[$i];
}
@@ -969,7 +969,7 @@ function select_get_val($key, &$val, $options_ary, $default, $num = true)
if (isset($_REQUEST[$key]) && is_string($_REQUEST[$key])) {
if (isset($options_ary[$_REQUEST[$key]])) {
- $val = ($num) ? intval($_REQUEST[$key]) : $_REQUEST[$key];
+ $val = ($num) ? (int)$_REQUEST[$key] : $_REQUEST[$key];
}
} elseif (isset($previous_settings[$key])) {
$val = $previous_settings[$key];
@@ -1100,7 +1100,7 @@ function str_short($text, $max_length, $space = ' ')
if ($max_length && mb_strlen($text, 'UTF-8') > $max_length) {
$text = mb_substr($text, 0, $max_length, 'UTF-8');
- if ($last_space_pos = $max_length - intval(strpos(strrev($text), $space))) {
+ if ($last_space_pos = $max_length - (int)strpos(strrev($text), $space)) {
if ($last_space_pos > round($max_length * 3 / 4)) {
$last_space_pos--;
$text = mb_substr($text, 0, $last_space_pos, 'UTF-8');
@@ -1158,7 +1158,7 @@ function show_bt_userdata($user_id)
'USER_RATIO' => get_bt_ratio($btu),
'MIN_DL_FOR_RATIO' => humn_size(MIN_DL_FOR_RATIO),
'MIN_DL_BYTES' => MIN_DL_FOR_RATIO,
- 'AUTH_KEY' => ($btu['auth_key']) ? $btu['auth_key'] : $lang['NONE'],
+ 'AUTH_KEY' => ($btu['auth_key']) ?: $lang['NONE'],
'TD_DL' => humn_size($btu['down_today']),
'TD_UL' => humn_size($btu['up_today']),
@@ -1300,7 +1300,7 @@ function get_userdata($u, $force_name = false, $allow_guest = false)
return false;
}
- if (intval($u) == GUEST_UID && $allow_guest) {
+ if ((int)$u == GUEST_UID && $allow_guest) {
if ($u_data = CACHE('bb_cache')->get('guest_userdata')) {
return $u_data;
}
@@ -1357,10 +1357,10 @@ function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = n
$not_auth_forums_fary = array_flip($mode);
$mode = 'not_auth_forums';
}
- if (is_null($max_length)) {
+ if (null === $max_length) {
$max_length = HTML_SELECT_MAX_LENGTH;
}
- $select = is_null($all_forums_option) ? array() : array($lang['ALL_AVAILABLE'] => $all_forums_option);
+ $select = null === $all_forums_option ? array() : array($lang['ALL_AVAILABLE'] => $all_forums_option);
if (!$forums = $datastore->get('cat_forums')) {
$datastore->update('cat_forums');
$forums = $datastore->get('cat_forums');
@@ -1442,9 +1442,7 @@ function setup_style()
require TEMPLATES_DIR . '/' . $tpl_dir_name . '/tpl_config.php';
- $theme = array('template_name' => $tpl_dir_name);
-
- return $theme;
+ return array('template_name' => $tpl_dir_name);
}
// Create date / time with format and friendly date
@@ -1725,7 +1723,7 @@ function bb_realpath($path)
function login_redirect($url = '')
{
- redirect(LOGIN_URL . '?redirect=' . (($url) ? $url : (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/')));
+ redirect(LOGIN_URL . '?redirect=' . (($url) ?: (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/')));
}
function meta_refresh($url, $time = 5)
@@ -1743,7 +1741,7 @@ function redirect($url)
trigger_error("Headers already sent in $filename($linenum)", E_USER_ERROR);
}
- if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") || strstr(urldecode($url), ';url')) {
+ if (false !== strpos(urldecode($url), "\n") || false !== strpos(urldecode($url), "\r") || false !== strpos(urldecode($url), ';url')) {
bb_die('Tried to redirect to potentially insecure url');
}
@@ -1792,7 +1790,7 @@ function get_forum_display_sort_option($selected_row = 0, $action = 'list', $lis
// build list
if ($action == 'list') {
- for ($i = 0; $i < count($listrow['lang_key']); $i++) {
+ for ($i = 0, $iMax = count($listrow['lang_key']); $i < $iMax; $i++) {
$selected = ($i == $selected_row) ? ' selected="selected"' : '';
$l_value = (isset($lang[$listrow['lang_key'][$i]])) ? $lang[$listrow['lang_key'][$i]] : $listrow['lang_key'][$i];
$res .= '';
@@ -1917,7 +1915,7 @@ function get_id_csv($ids)
{
$ids = array_values((array)$ids);
array_deep($ids, 'intval', 'one-dimensional');
- return (string)join(',', $ids);
+ return (string)implode(',', $ids);
}
// $ids - array(id1,id2,..) or (string) id1,id2,..
@@ -1975,7 +1973,7 @@ class log_action
}
}
- public function mod($type_name, $args = array())
+ public function mod($type_name, array $args = array())
{
global $userdata;
@@ -2023,7 +2021,7 @@ class log_action
DB()->query("INSERT INTO " . BB_LOG . " $sql_args");
}
- public function admin($type_name, $args = array())
+ public function admin($type_name, array $args = array())
{
$this->mod($type_name, $args);
}
@@ -2034,7 +2032,7 @@ function get_topic_icon($topic, $is_unread = null)
global $bb_cfg, $images;
$t_hot = ($topic['topic_replies'] >= $bb_cfg['hot_threshold']);
- $is_unread = is_null($is_unread) ? is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']) : $is_unread;
+ $is_unread = null === $is_unread ? is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']) : $is_unread;
if ($topic['topic_status'] == TOPIC_MOVED) {
$folder_image = $images['folder'];
@@ -2237,9 +2235,9 @@ function init_sphinx()
if (!isset($sphinx)) {
$sphinx = \Sphinx\SphinxClient::create();
- $sphinx->SetConnectTimeout(5);
- $sphinx->SetRankingMode($sphinx::SPH_RANK_NONE);
- $sphinx->SetMatchMode($sphinx::SPH_MATCH_BOOLEAN);
+ $sphinx->setConnectTimeout(5);
+ $sphinx->setRankingMode($sphinx::SPH_RANK_NONE);
+ $sphinx->setMatchMode($sphinx::SPH_MATCH_BOOLEAN);
}
return $sphinx;
@@ -2251,13 +2249,13 @@ function log_sphinx_error($err_type, $err_msg, $query = '')
'negation on top level',
'Query word length is less than min prefix length',
);
- if (!count($ignore_err_txt) || !preg_match('#' . join('|', $ignore_err_txt) . '#i', $err_msg)) {
+ if (!count($ignore_err_txt) || !preg_match('#' . implode('|', $ignore_err_txt) . '#i', $err_msg)) {
$orig_query = strtr($_REQUEST['nm'], array("\n" => '\n'));
bb_log(date('m-d H:i:s') . " | $err_type | $err_msg | $orig_query | $query" . LOG_LF, 'sphinx_error');
}
}
-function get_title_match_topics($title_match_sql, $forum_ids = array())
+function get_title_match_topics($title_match_sql, array $forum_ids = array())
{
global $bb_cfg, $sphinx, $userdata, $title_match, $lang;
@@ -2272,28 +2270,28 @@ function get_title_match_topics($title_match_sql, $forum_ids = array())
$where = ($title_match) ? 'topics' : 'posts';
- $sphinx->SetServer($bb_cfg['sphinx_topic_titles_host'], $bb_cfg['sphinx_topic_titles_port']);
+ $sphinx->setServer($bb_cfg['sphinx_topic_titles_host'], $bb_cfg['sphinx_topic_titles_port']);
if ($forum_ids) {
- $sphinx->SetFilter('forum_id', $forum_ids, false);
+ $sphinx->setFilter('forum_id', $forum_ids, false);
}
if (preg_match('#^"[^"]+"$#u', $title_match_sql)) {
- $sphinx->SetMatchMode($sphinx::SPH_MATCH_PHRASE);
+ $sphinx->setMatchMode($sphinx::SPH_MATCH_PHRASE);
}
- if ($result = $sphinx->Query($title_match_sql, $where, $userdata['username'] . ' (' . CLIENT_IP . ')')) {
+ if ($result = $sphinx->query($title_match_sql, $where, $userdata['username'] . ' (' . CLIENT_IP . ')')) {
if (!empty($result['matches'])) {
$where_ids = array_keys($result['matches']);
}
- } elseif ($error = $sphinx->GetLastError()) {
+ } elseif ($error = $sphinx->getLastError()) {
if (strpos($error, 'errno=110')) {
bb_die($lang['SEARCH_ERROR']);
}
log_sphinx_error('ERR', $error, $title_match_sql);
}
- if ($warning = $sphinx->GetLastWarning()) {
+ if ($warning = $sphinx->getLastWarning()) {
log_sphinx_error('wrn', $warning, $title_match_sql);
}
} elseif ($bb_cfg['search_engine_type'] == 'mysql') {
- $where_forum = ($forum_ids) ? "AND forum_id IN(" . join(',', $forum_ids) . ")" : '';
+ $where_forum = ($forum_ids) ? "AND forum_id IN(" . implode(',', $forum_ids) . ")" : '';
$search_bool_mode = ($bb_cfg['allow_search_in_bool_mode']) ? ' IN BOOLEAN MODE' : '';
if ($title_match) {
diff --git a/library/includes/functions_admin.php b/library/includes/functions_admin.php
index 85f0005a9..77c4423c0 100644
--- a/library/includes/functions_admin.php
+++ b/library/includes/functions_admin.php
@@ -58,7 +58,7 @@ function sync($type, $id)
// начальное обнуление значений
$forum_ary = explode(',', $forum_csv);
- DB()->query("REPLACE INTO $tmp_sync_forums (forum_id) VALUES(" . join('),(', $forum_ary) . ")");
+ DB()->query("REPLACE INTO $tmp_sync_forums (forum_id) VALUES(" . implode('),(', $forum_ary) . ")");
DB()->query("
REPLACE INTO $tmp_sync_forums
@@ -761,5 +761,5 @@ function get_usernames_for_log($user_id)
}
}
- return join(', ', $users_log_msg);
+ return implode(', ', $users_log_msg);
}
diff --git a/library/includes/functions_admin_torrent.php b/library/includes/functions_admin_torrent.php
index aad00e08a..0100be6e5 100644
--- a/library/includes/functions_admin_torrent.php
+++ b/library/includes/functions_admin_torrent.php
@@ -43,11 +43,11 @@ function update_table_bool($table_name, $key, $field_name, $field_def_val)
$in_sql = array();
foreach ($_POST[$field_name] as $i => $val) {
- $in_sql[] = intval($val);
+ $in_sql[] = (int)$val;
}
// Update status
- if ($in_sql = join(',', $in_sql)) {
+ if ($in_sql = implode(',', $in_sql)) {
$sql = "UPDATE $table_name
SET $field_name = 1
WHERE $key IN($in_sql)";
@@ -109,7 +109,7 @@ function update_config_table($table_name, $default_cfg, $cfg, $type)
} elseif ($type == 'bool') {
$config_value = ($_POST[$config_name]) ? 1 : 0;
} elseif ($type == 'num') {
- $config_value = abs(intval($_POST[$config_name]));
+ $config_value = abs((int)$_POST[$config_name]);
} else {
return;
}
diff --git a/library/includes/functions_atom.php b/library/includes/functions_atom.php
index e3e5e613c..a0ecf1e46 100644
--- a/library/includes/functions_atom.php
+++ b/library/includes/functions_atom.php
@@ -211,7 +211,7 @@ function create_atom($file_path, $mode, $id, $title, $topics)
}
$atom .= "";
@unlink($file_path);
- $fp = fopen($file_path, "w");
+ $fp = fopen($file_path, 'wb');
fwrite($fp, $atom);
fclose($fp);
return true;
diff --git a/library/includes/functions_dev.php b/library/includes/functions_dev.php
index 28a7d56e7..6c31a0a03 100644
--- a/library/includes/functions_dev.php
+++ b/library/includes/functions_dev.php
@@ -70,7 +70,7 @@ function get_sql_log_html($db_obj, $log_name)
. '' . $time . ' '
. '' . $perc . ''
. ' '
- . '' . $sql . ''
+ . '' . $sql . ''
. ' # ' . $info . ' '
. ''
. "\n";
diff --git a/library/includes/functions_group.php b/library/includes/functions_group.php
index 31df65b00..e354b6c8f 100644
--- a/library/includes/functions_group.php
+++ b/library/includes/functions_group.php
@@ -32,7 +32,7 @@ function update_user_level($user_id)
global $datastore;
if (is_array($user_id)) {
- $user_id = join(',', $user_id);
+ $user_id = implode(',', $user_id);
}
$user_groups_in = ($user_id !== 'all') ? "AND ug.user_id IN($user_id)" : '';
$users_in = ($user_id !== 'all') ? "AND u.user_id IN($user_id)" : '';
@@ -203,7 +203,7 @@ function store_permissions($group_id, $auth_ary)
function update_user_permissions($user_id = 'all')
{
if (is_array($user_id)) {
- $user_id = join(',', $user_id);
+ $user_id = implode(',', $user_id);
}
$delete_in = ($user_id !== 'all') ? " WHERE user_id IN($user_id)" : '';
$users_in = ($user_id !== 'all') ? "AND ug.user_id IN($user_id)" : '';
diff --git a/library/includes/functions_post.php b/library/includes/functions_post.php
index 52fe4afa5..26e75ad8c 100644
--- a/library/includes/functions_post.php
+++ b/library/includes/functions_post.php
@@ -318,7 +318,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
foreach ($sql as $row) {
$user_id_sql[] = ',' . $row['ban_userid'];
}
- $user_id_sql = join('', $user_id_sql);
+ $user_id_sql = implode('', $user_id_sql);
$watch_list = DB()->fetch_rowset("SELECT u.username, u.user_id, u.user_email, u.user_lang
FROM " . BB_TOPICS_WATCH . " tw, " . BB_USERS . " u
@@ -362,7 +362,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
$update_watched_sql[] = $row['user_id'];
}
- $update_watched_sql = join(',', $update_watched_sql);
+ $update_watched_sql = implode(',', $update_watched_sql);
}
if ($update_watched_sql) {
diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php
index fc9df9c85..181604f7b 100644
--- a/library/includes/functions_torrent.php
+++ b/library/includes/functions_torrent.php
@@ -31,7 +31,7 @@ function get_torrent_info($attach_id)
{
global $lang;
- $attach_id = intval($attach_id);
+ $attach_id = (int)$attach_id;
$sql = "
SELECT
@@ -162,7 +162,7 @@ function delete_torrent($attach_id, $mode = '')
{
global $lang, $reg_mode, $topic_id;
- $attach_id = intval($attach_id);
+ $attach_id = (int)$attach_id;
$reg_mode = $mode;
if (!$torrent = get_torrent_info($attach_id)) {
@@ -223,7 +223,7 @@ function change_tor_type($attach_id, $tor_status_gold)
}
$topic_id = $torrent['topic_id'];
- $tor_status_gold = intval($tor_status_gold);
+ $tor_status_gold = (int)$tor_status_gold;
$info_hash = null;
DB()->query("UPDATE " . BB_BT_TORRENTS . " SET tor_type = $tor_status_gold WHERE topic_id = $topic_id LIMIT 1");
@@ -241,7 +241,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
{
global $bb_cfg, $lang, $reg_mode, $tr_cfg;
- $attach_id = intval($attach_id);
+ $attach_id = (int)$attach_id;
$reg_mode = $mode;
if (!$torrent = get_torrent_info($attach_id)) {
@@ -286,7 +286,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
if ($bb_cfg['bt_disable_dht']) {
$tor['info']['private'] = (int)1;
- $fp = fopen($filename, 'w+');
+ $fp = fopen($filename, 'wb+');
fwrite($fp, bencode($tor));
fclose($fp);
}
@@ -462,7 +462,7 @@ function send_torrent_with_passkey($filename)
bb_die('This is not a bencoded file');
}
- $announce = $bb_cfg['ocelot']['enabled'] ? strval($bb_cfg['ocelot']['url'] . $passkey_val . "/announce") : strval($ann_url . "?$passkey_key=$passkey_val");
+ $announce = $bb_cfg['ocelot']['enabled'] ? (string)($bb_cfg['ocelot']['url'] . $passkey_val . "/announce") : (string)($ann_url . "?$passkey_key=$passkey_val");
// Replace original announce url with tracker default
if ($bb_cfg['bt_replace_ann_url'] || !isset($tor['announce'])) {
@@ -494,13 +494,13 @@ function send_torrent_with_passkey($filename)
$publisher_name = $bb_cfg['server_name'];
$publisher_url = make_url(TOPIC_URL . $topic_id);
- $tor['publisher'] = strval($publisher_name);
+ $tor['publisher'] = (string)$publisher_name;
unset($tor['publisher.utf-8']);
- $tor['publisher-url'] = strval($publisher_url);
+ $tor['publisher-url'] = (string)$publisher_url;
unset($tor['publisher-url.utf-8']);
- $tor['comment'] = strval($publisher_url);
+ $tor['comment'] = (string)$publisher_url;
unset($tor['comment.utf-8']);
// Send torrent
@@ -624,11 +624,7 @@ function ocelot_update_tracker($action, $updates)
$max_attempts = 3;
$err = false;
- if (ocelot_send_request($get, $max_attempts, $err) === false) {
- return false;
- }
-
- return true;
+ return !(ocelot_send_request($get, $max_attempts, $err) === false);
}
function ocelot_send_request($get, $max_attempts = 1, &$err = false)
diff --git a/library/includes/functions_upload.php b/library/includes/functions_upload.php
index e15af4044..cebdaee8a 100644
--- a/library/includes/functions_upload.php
+++ b/library/includes/functions_upload.php
@@ -129,13 +129,15 @@ class upload_common
return true;
}
- public function store($mode = '', $params = array())
+ public function store($mode = '', array $params = array())
{
if ($mode == 'avatar') {
delete_avatar($params['user_id'], $params['avatar_ext_id']);
$file_path = get_avatar_path($params['user_id'], $this->file_ext_id);
return $this->_move($file_path);
- } elseif ($mode == 'attach') {
+ }
+
+ if ($mode == 'attach') {
$file_path = get_attach_path($params['topic_id']);
return $this->_move($file_path);
} else {
diff --git a/library/includes/functions_validate.php b/library/includes/functions_validate.php
index 2530945d2..cc3ed5a9d 100644
--- a/library/includes/functions_validate.php
+++ b/library/includes/functions_validate.php
@@ -71,7 +71,7 @@ function validate_username($username, $check_ban_and_taken = true)
foreach (DB()->fetch_rowset("SELECT disallow_username FROM " . BB_DISALLOW . " ORDER BY NULL") as $row) {
$banned_names[] = str_replace('\*', '.*?', preg_quote($row['disallow_username'], '#u'));
}
- if ($banned_names_exp = join('|', $banned_names)) {
+ if ($banned_names_exp = implode('|', $banned_names)) {
if (preg_match("#^($banned_names_exp)$#iu", $username)) {
return $lang['USERNAME_DISALLOWED'];
}
@@ -99,7 +99,7 @@ function validate_email($email, $check_ban_and_taken = true)
foreach (DB()->fetch_rowset("SELECT ban_email FROM " . BB_BANLIST . " ORDER BY NULL") as $row) {
$banned_emails[] = str_replace('\*', '.*?', preg_quote($row['ban_email'], '#'));
}
- if ($banned_emails_exp = join('|', $banned_emails)) {
+ if ($banned_emails_exp = implode('|', $banned_emails)) {
if (preg_match("#^($banned_emails_exp)$#i", $email)) {
return sprintf($lang['EMAIL_BANNED'], $email);
}
diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php
index e04f2276a..43a086c25 100644
--- a/library/includes/init_bb.php
+++ b/library/includes/init_bb.php
@@ -26,7 +26,7 @@
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
-if (PHP_VERSION < '5.3') {
+if (version_compare(PHP_VERSION, '5.3', '<')) {
die('TorrentPier requires PHP version 5.3+. Your PHP version ' . PHP_VERSION);
}
if (!defined('BB_SCRIPT')) {
@@ -378,7 +378,7 @@ define('SELECT', 6);
if (!empty($banned_user_agents)) {
foreach ($banned_user_agents as $agent) {
- if (strstr(USER_AGENT, $agent)) {
+ if (false !== strpos(USER_AGENT, $agent)) {
$filename = 'Download files by using browser';
$output = '@';
header('Content-Type: text/plain');
diff --git a/library/includes/online_userlist.php b/library/includes/online_userlist.php
index e057554eb..22e7cab2f 100644
--- a/library/includes/online_userlist.php
+++ b/library/includes/online_userlist.php
@@ -94,7 +94,7 @@ foreach (DB()->fetch_rowset($sql) as $u) {
$stat[] = "t:$t";
}
- $ulist[$level][] = ($stat) ? "$name [" . join(', ', $stat) . ']' : $name;
+ $ulist[$level][] = ($stat) ? "$name [" . implode(', ', $stat) . ']' : $name;
} else {
$guests_online = $u['ips'];
$users_cnt['guest'] = $guests_online;
@@ -111,18 +111,18 @@ if ($ulist) {
if (count($users) > 200) {
$style = 'margin: 3px 0; padding: 2px 4px; border: 1px inset; height: 200px; overflow: auto;';
- $block[] = "\n" . join(",\n", $users) . "
\n";
+ $block[] = "\n" . implode(",\n", $users) . "
\n";
$short[] = '' . $lang['USERS'] . ': ' . count($users) . '';
} else {
- $inline[] = join(",\n", $users);
- $short[] = join(",\n", $users);
+ $inline[] = implode(",\n", $users);
+ $short[] = implode(",\n", $users);
}
$logged_online += count($users);
}
- $online['userlist'] = join(",\n", $inline) . join("\n", $block);
- $online_short['userlist'] = join(",\n", $short);
+ $online['userlist'] = implode(",\n", $inline) . implode("\n", $block);
+ $online_short['userlist'] = implode(",\n", $short);
}
if (!$online['userlist']) {
diff --git a/library/includes/page_footer_dev.php b/library/includes/page_footer_dev.php
index 5dba30efb..cdcf94831 100644
--- a/library/includes/page_footer_dev.php
+++ b/library/includes/page_footer_dev.php
@@ -124,9 +124,9 @@ function fixSqlLog() {
echo '';
if ($sql_log) {
- echo '' . ($sql_log ? $sql_log : '') . '
';
+ echo '' . ($sql_log ?: '') . '
';
}
?>
\ No newline at end of file
+
diff --git a/library/includes/page_header.php b/library/includes/page_header.php
index 931ab6b5e..a3117f812 100644
--- a/library/includes/page_header.php
+++ b/library/includes/page_header.php
@@ -153,7 +153,7 @@ $template->assign_vars(array(
'FULL_URL' => FULL_URL,
'CURRENT_TIME' => sprintf($lang['CURRENT_TIME'], bb_date(TIMENOW, $bb_cfg['last_visit_date_format'], false)),
- 'S_TIMEZONE' => preg_replace('/\(.*?\)/', '', sprintf($lang['ALL_TIMES'], $lang['TZ'][str_replace(',', '.', floatval($bb_cfg['board_timezone']))])),
+ 'S_TIMEZONE' => preg_replace('/\(.*?\)/', '', sprintf($lang['ALL_TIMES'], $lang['TZ'][str_replace(',', '.', (float)$bb_cfg['board_timezone'])])),
'BOARD_TIMEZONE' => $bb_cfg['board_timezone'],
'PM_INFO' => $pm_info,
@@ -248,7 +248,7 @@ if (!empty($page_cfg['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torhelp'])
}
$template->assign_vars(array(
- 'TORHELP_TOPICS' => join("\n", $torhelp_topics),
+ 'TORHELP_TOPICS' => implode("\n", $torhelp_topics),
));
}
}
diff --git a/library/includes/posting_tpl.php b/library/includes/posting_tpl.php
index 0cf8e54b8..63e41ed5b 100644
--- a/library/includes/posting_tpl.php
+++ b/library/includes/posting_tpl.php
@@ -90,7 +90,7 @@ if ($edit_tpl_mode) {
'TPL_COMMENT' => $tpl_data['tpl_comment'],
'TPL_RULES_POST_ID' => $tpl_data['tpl_rules_post_id'],
'TPL_LAST_EDIT_TIME' => bb_date($tpl_data['tpl_last_edit_tm'], 'd-M-y H:i'),
- 'TPL_LAST_EDIT_USER' => get_username(intval($tpl_data['tpl_last_edit_by'])),
+ 'TPL_LAST_EDIT_USER' => get_username((int)$tpl_data['tpl_last_edit_by']),
'TPL_LAST_EDIT_TIMESTAMP' => $tpl_data['tpl_last_edit_tm'],
));
}
diff --git a/library/includes/sessions.php b/library/includes/sessions.php
index 21a0ee9d3..bc3943b29 100644
--- a/library/includes/sessions.php
+++ b/library/includes/sessions.php
@@ -85,7 +85,7 @@ class user_common
/**
* Shortcuts
*/
- public $id = null;
+ public $id;
/**
* Misc
@@ -103,7 +103,7 @@ class user_common
/**
* Start session (restore existent session or create new)
*/
- public function session_start($cfg = array())
+ public function session_start(array $cfg = array())
{
global $bb_cfg;
@@ -183,7 +183,7 @@ class user_common
$login = false;
$user_id = ($bb_cfg['allow_autologin'] && $this->sessiondata['uk'] && $this->sessiondata['uid']) ? $this->sessiondata['uid'] : GUEST_UID;
- if ($userdata = get_userdata(intval($user_id), false, true)) {
+ if ($userdata = get_userdata((int)$user_id, false, true)) {
if ($userdata['user_id'] != GUEST_UID && $userdata['user_active']) {
if (verify_id($this->sessiondata['uk'], LOGIN_KEY_LENGTH) && $this->verify_autologin_id($userdata, true, false)) {
$login = ($userdata['autologin_id'] && $this->sessiondata['uk'] === $userdata['autologin_id']);
@@ -431,7 +431,7 @@ class user_common
}
// user_id
if (!empty($sd_resv['uid'])) {
- $this->sessiondata['uid'] = intval($sd_resv['uid']);
+ $this->sessiondata['uid'] = (int)$sd_resv['uid'];
}
// sid
if (!empty($sd_resv['sid']) && verify_id($sd_resv['sid'], SID_LENGTH)) {
@@ -676,7 +676,7 @@ class user_common
}
}
- return join(',', $not_auth_forums);
+ return implode(',', $not_auth_forums);
}
/**
@@ -709,7 +709,7 @@ class user_common
switch ($return_as) {
case 'csv':
- return join(',', $excluded);
+ return implode(',', $excluded);
case 'array':
return $excluded;
case 'flip':
diff --git a/library/includes/smtp.php b/library/includes/smtp.php
index 612c3ea70..c138bca1e 100644
--- a/library/includes/smtp.php
+++ b/library/includes/smtp.php
@@ -32,7 +32,7 @@ define('SMTP_INCLUDED', 1);
function server_parse($socket, $response, $line = __LINE__)
{
$server_response = '';
- while (substr($server_response, 3, 1) != ' ') {
+ while ($server_response[3] != ' ') {
if (!($server_response = fgets($socket, 256))) {
bb_die('Could not get mail server response codes');
}
@@ -53,13 +53,13 @@ function smtpmail($mail_to, $subject, $message, $headers = '')
if ($headers != '') {
if (is_array($headers)) {
- if (sizeof($headers) > 1) {
- $headers = join("\n", $headers);
+ if (count($headers) > 1) {
+ $headers = implode("\n", $headers);
} else {
$headers = $headers[0];
}
}
- $headers = chop($headers);
+ $headers = rtrim($headers);
// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?\r\n");
+ fwrite($socket, "MAIL FROM: <" . $bb_cfg['board_email'] . ">\r\n");
server_parse($socket, "250", __LINE__);
// Add an additional bit of error checking to the To field.
$mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
if (preg_match('#[^ ]+\@[^ ]+#', $mail_to)) {
- fputs($socket, "RCPT TO: <$mail_to>\r\n");
+ fwrite($socket, "RCPT TO: <$mail_to>\r\n");
server_parse($socket, "250", __LINE__);
}
@@ -140,7 +140,7 @@ function smtpmail($mail_to, $subject, $message, $headers = '')
// Add an additional bit of error checking to bcc header...
$bcc_address = trim($bcc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $bcc_address)) {
- fputs($socket, "RCPT TO: <$bcc_address>\r\n");
+ fwrite($socket, "RCPT TO: <$bcc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}
@@ -150,35 +150,35 @@ function smtpmail($mail_to, $subject, $message, $headers = '')
// Add an additional bit of error checking to cc header
$cc_address = trim($cc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $cc_address)) {
- fputs($socket, "RCPT TO: <$cc_address>\r\n");
+ fwrite($socket, "RCPT TO: <$cc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}
// Ok now we tell the server we are ready to start sending data
- fputs($socket, "DATA\r\n");
+ fwrite($socket, "DATA\r\n");
// This is the last response code we look for until the end of the message.
server_parse($socket, "354", __LINE__);
// Send the Subject Line...
- fputs($socket, "Subject: $subject\r\n");
+ fwrite($socket, "Subject: $subject\r\n");
// Now the To Header.
- fputs($socket, "To: $mail_to\r\n");
+ fwrite($socket, "To: $mail_to\r\n");
// Now any custom headers....
- fputs($socket, "$headers\r\n\r\n");
+ fwrite($socket, "$headers\r\n\r\n");
// Ok now we are ready for the message...
- fputs($socket, "$message\r\n");
+ fwrite($socket, "$message\r\n");
// Ok the all the ingredients are mixed in let's cook this puppy...
- fputs($socket, ".\r\n");
+ fwrite($socket, ".\r\n");
server_parse($socket, "250", __LINE__);
// Now tell the server we are done and close the socket...
- fputs($socket, "QUIT\r\n");
+ fwrite($socket, "QUIT\r\n");
fclose($socket);
return true;
diff --git a/library/includes/template.php b/library/includes/template.php
index a2351c624..d7dc15839 100644
--- a/library/includes/template.php
+++ b/library/includes/template.php
@@ -173,7 +173,7 @@ class template
$filename = $this->replace[$filename];
}
// Check if it's an absolute or relative path.
- if ((substr($filename, 0, 1) !== '/') && (substr($filename, 1, 1) !== ':')) {
+ if (($filename[0] !== '/') && ($filename[1] !== ':')) {
return $this->root . '/' . $filename;
} else {
return $filename;
@@ -393,15 +393,15 @@ class template
*/
public function assign_block_vars($blockname, $vararray)
{
- if (strstr($blockname, '.')) {
+ if (false !== strpos($blockname, '.')) {
// Nested block.
$blocks = explode('.', $blockname);
- $blockcount = sizeof($blocks) - 1;
+ $blockcount = count($blocks) - 1;
$str = &$this->_tpldata;
for ($i = 0; $i < $blockcount; $i++) {
$str = &$str[$blocks[$i] . '.'];
- $str = &$str[sizeof($str) - 1];
+ $str = &$str[count($str) - 1];
}
// Now we add the block that we're actually assigning to.
// We're adding a new iteration to this block with the given
@@ -517,7 +517,7 @@ class template
{
// Get an array of the blocks involved.
$blocks = explode('.', $blockname);
- $blockcount = sizeof($blocks) - 1;
+ $blockcount = count($blocks) - 1;
if ($include_last_iterator) {
return '$' . $blocks[$blockcount] . '_item';
} else {
@@ -686,7 +686,7 @@ class template
} else {
// This block is nested.
// Generate a namespace string for this block.
- $namespace = join('.', $block_names);
+ $namespace = implode('.', $block_names);
// strip leading period from root level..
$namespace = substr($namespace, 2);
// Get a reference to the data array for this block that depends on the
@@ -774,7 +774,7 @@ class template
if (!$count_if) {
$keyword_type = XS_TAG_IF;
}
- $str = $this->compile_tag_if($params_str, $keyword_type == XS_TAG_IF ? false : true);
+ $str = $this->compile_tag_if($params_str, $keyword_type != XS_TAG_IF);
if ($str) {
$compiled[] = '';
if ($keyword_type == XS_TAG_IF) {
@@ -806,7 +806,7 @@ class template
$code_header = '';
$code_footer = '';
- return $code_header . join('', $compiled) . $code_footer;
+ return $code_header . implode('', $compiled) . $code_footer;
}
/*
@@ -821,7 +821,7 @@ class template
// This one will handle varrefs WITH namespaces
$varrefs = array();
preg_match_all('#\{(([a-z0-9\-_]+?\.)+)([a-z0-9\-_]+?)\}#is', $code, $varrefs);
- $varcount = sizeof($varrefs[1]);
+ $varcount = count($varrefs[1]);
$search = array();
$replace = array();
for ($i = 0; $i < $varcount; $i++) {
@@ -907,12 +907,12 @@ class template
break;
case '(':
- array_push($is_arg_stack, $i);
+ $is_arg_stack[] = $i;
break;
case 'is':
$is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1;
- $is_arg = join(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
+ $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
$new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1));
@@ -948,9 +948,9 @@ class template
}
if ($elseif) {
- $code = '} elseif (' . join(' ', $tokens) . ') {';
+ $code = '} elseif (' . implode(' ', $tokens) . ') {';
} else {
- $code = 'if (' . join(' ', $tokens) . ') {';
+ $code = 'if (' . implode(' ', $tokens) . ') {';
}
return $code;
diff --git a/library/includes/ucp/activate.php b/library/includes/ucp/activate.php
index 4320822a2..588571dd7 100644
--- a/library/includes/ucp/activate.php
+++ b/library/includes/ucp/activate.php
@@ -33,7 +33,7 @@ if (empty($_GET['u']) || empty($_GET['act_key'])) {
$sql = "SELECT user_active, user_id, username, user_email, user_newpasswd, user_lang, user_actkey
FROM " . BB_USERS . "
- WHERE user_id = " . intval($_GET[POST_USERS_URL]);
+ WHERE user_id = " . (int)$_GET[POST_USERS_URL];
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not obtain user information');
}
diff --git a/library/includes/ucp/email.php b/library/includes/ucp/email.php
index a0f68e9af..1b89d4fa0 100644
--- a/library/includes/ucp/email.php
+++ b/library/includes/ucp/email.php
@@ -35,7 +35,7 @@ if (!$bb_cfg['board_email_form']) {
set_die_append_msg();
if (!empty($_GET[POST_USERS_URL]) || !empty($_POST[POST_USERS_URL])) {
- $user_id = (!empty($_GET[POST_USERS_URL])) ? intval($_GET[POST_USERS_URL]) : intval($_POST[POST_USERS_URL]);
+ $user_id = (!empty($_GET[POST_USERS_URL])) ? (int)$_GET[POST_USERS_URL] : (int)$_POST[POST_USERS_URL];
} else {
bb_die($lang['NO_USER_SPECIFIED']);
}
@@ -97,7 +97,7 @@ if ($row = DB()->fetch_row($sql)) {
'USERNAME' => profile_url($row),
'S_HIDDEN_FIELDS' => '',
'S_POST_ACTION' => "profile.php?mode=email&" . POST_USERS_URL . "=$user_id",
- 'ERROR_MESSAGE' => ($errors) ? join('
', array_unique($errors)) : '',
+ 'ERROR_MESSAGE' => ($errors) ? implode('
', array_unique($errors)) : '',
));
print_page('usercp_email.tpl');
diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php
index 6413c6ecc..a4dbe5b30 100644
--- a/library/includes/ucp/register.php
+++ b/library/includes/ucp/register.php
@@ -147,7 +147,7 @@ switch ($mode) {
} else {
$pr_user_id = $userdata['user_id'];
}
- $profile_fields_sql = join(', ', array_keys($profile_fields));
+ $profile_fields_sql = implode(', ', array_keys($profile_fields));
$sql = "
SELECT
user_id,
@@ -679,7 +679,7 @@ $template->assign_vars($tp_data);
$template->assign_vars(array(
'PAGE_TITLE' => ($mode == 'editprofile') ? $lang['EDIT_PROFILE'] . ($adm_edit ? " :: {$pr_data['username']}" : '') : $lang['REGISTER'],
'SHOW_REG_AGREEMENT' => ($mode == 'register' && !IS_ADMIN),
- 'ERROR_MESSAGE' => ($errors) ? join('
', array_unique($errors)) : '',
+ 'ERROR_MESSAGE' => ($errors) ? implode('
', array_unique($errors)) : '',
'MODE' => $mode,
'EDIT_PROFILE' => ($mode == 'editprofile'),
'ADM_EDIT' => $adm_edit,
diff --git a/library/includes/ucp/topic_watch.php b/library/includes/ucp/topic_watch.php
index 0bf9e5fd7..44ed2a6aa 100644
--- a/library/includes/ucp/topic_watch.php
+++ b/library/includes/ucp/topic_watch.php
@@ -32,7 +32,7 @@ $page_cfg['include_bbcode_js'] = true;
$tracking_topics = get_tracks('topic');
$user_id = $userdata['user_id'];
-$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
+$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
$per_page = $bb_cfg['topics_per_page'];
if (isset($_POST['topic_id_list'])) {
@@ -53,7 +53,7 @@ if (!($result = DB()->sql_query($sql))) {
bb_die('Could not obtain watch topic information #2');
}
$row = DB()->sql_fetchrow($result);
-$watch_count = ($row['watch_count']) ? $row['watch_count'] : 0;
+$watch_count = ($row['watch_count']) ?: 0;
DB()->sql_freeresult($result);
if ($watch_count > 0) {
@@ -74,7 +74,7 @@ if ($watch_count > 0) {
$watch = DB()->sql_fetchrowset($result);
if ($watch) {
- for ($i = 0; $i < count($watch); $i++) {
+ for ($i = 0, $iMax = count($watch); $i < $iMax; $i++) {
$is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']);
$template->assign_block_vars('watch', array(
diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php
index fed176037..4d50f9e67 100644
--- a/library/includes/ucp/viewprofile.php
+++ b/library/includes/ucp/viewprofile.php
@@ -162,7 +162,7 @@ if (IS_ADMIN) {
if ($single) {
$group_membership[] = $lang['INDIVIDUAL'];
}
- $group_membership = join(', ', $group_membership);
+ $group_membership = implode(', ', $group_membership);
}
$template->assign_vars(array(
'GROUP_MEMBERSHIP' => (bool)$group_membership,
@@ -232,6 +232,6 @@ if (bf($profiledata['user_opt'], 'user_opt', 'dis_topic')) {
$user_restrictions[] = $lang['NEW_THREADS'];
}
-$template->assign_var('USER_RESTRICTIONS', join('', $user_restrictions));
+$template->assign_var('USER_RESTRICTIONS', implode('', $user_restrictions));
print_page('usercp_viewprofile.tpl');
diff --git a/library/includes/ucp/viewtorrent.php b/library/includes/ucp/viewtorrent.php
index eee55e876..36644d7a5 100644
--- a/library/includes/ucp/viewtorrent.php
+++ b/library/includes/ucp/viewtorrent.php
@@ -74,8 +74,8 @@ if ($releasing) {
'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
'TOR_TYPE' => is_gold($row['tor_type']),
- 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
- 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ?: 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ?: 0,
'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') . '/s' : '-',
));
@@ -94,8 +94,8 @@ if ($seeding) {
'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
'TOR_TYPE' => is_gold($row['tor_type']),
- 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
- 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ?: 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ?: 0,
'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') . '/s' : '-',
));
@@ -117,8 +117,8 @@ if ($leeching) {
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
'COMPL_PERC' => $compl_perc,
'TOR_TYPE' => is_gold($row['tor_type']),
- 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
- 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ?: 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ?: 0,
'SPEED_DOWN' => ($row['speed_down']) ? humn_size($row['speed_down'], 0, 'KB') . '/s' : '-',
));
diff --git a/library/language/af/main.php b/library/language/af/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/af/main.php
+++ b/library/language/af/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ar/main.php b/library/language/ar/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ar/main.php
+++ b/library/language/ar/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/av/main.php b/library/language/av/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/av/main.php
+++ b/library/language/av/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/az/main.php b/library/language/az/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/az/main.php
+++ b/library/language/az/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ba/main.php b/library/language/ba/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ba/main.php
+++ b/library/language/ba/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/be/main.php b/library/language/be/main.php
index 2e01d2316..d554fc45d 100644
--- a/library/language/be/main.php
+++ b/library/language/be/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/bg/main.php b/library/language/bg/main.php
index 28b992a2f..11a871615 100644
--- a/library/language/bg/main.php
+++ b/library/language/bg/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/bs/main.php b/library/language/bs/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/bs/main.php
+++ b/library/language/bs/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ca/main.php b/library/language/ca/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ca/main.php
+++ b/library/language/ca/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/cs/main.php b/library/language/cs/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/cs/main.php
+++ b/library/language/cs/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/cv/main.php b/library/language/cv/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/cv/main.php
+++ b/library/language/cv/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/da/main.php b/library/language/da/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/da/main.php
+++ b/library/language/da/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/de/main.php b/library/language/de/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/de/main.php
+++ b/library/language/de/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/el/main.php b/library/language/el/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/el/main.php
+++ b/library/language/el/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/en/main.php b/library/language/en/main.php
index 35920cfd1..609897008 100644
--- a/library/language/en/main.php
+++ b/library/language/en/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/es/main.php b/library/language/es/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/es/main.php
+++ b/library/language/es/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/et/main.php b/library/language/et/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/et/main.php
+++ b/library/language/et/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/fi/main.php b/library/language/fi/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/fi/main.php
+++ b/library/language/fi/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/fr/main.php b/library/language/fr/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/fr/main.php
+++ b/library/language/fr/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/he/main.php b/library/language/he/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/he/main.php
+++ b/library/language/he/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/hi/main.php b/library/language/hi/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/hi/main.php
+++ b/library/language/hi/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/hr/main.php b/library/language/hr/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/hr/main.php
+++ b/library/language/hr/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/hu/main.php b/library/language/hu/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/hu/main.php
+++ b/library/language/hu/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/hy/main.php b/library/language/hy/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/hy/main.php
+++ b/library/language/hy/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/id/main.php b/library/language/id/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/id/main.php
+++ b/library/language/id/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/it/main.php b/library/language/it/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/it/main.php
+++ b/library/language/it/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ja/main.php b/library/language/ja/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ja/main.php
+++ b/library/language/ja/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ka/main.php b/library/language/ka/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ka/main.php
+++ b/library/language/ka/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/kk/main.php b/library/language/kk/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/kk/main.php
+++ b/library/language/kk/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ko/main.php b/library/language/ko/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ko/main.php
+++ b/library/language/ko/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ky/main.php b/library/language/ky/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ky/main.php
+++ b/library/language/ky/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/lt/main.php b/library/language/lt/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/lt/main.php
+++ b/library/language/lt/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/lv/main.php b/library/language/lv/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/lv/main.php
+++ b/library/language/lv/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/nl/main.php b/library/language/nl/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/nl/main.php
+++ b/library/language/nl/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/no/main.php b/library/language/no/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/no/main.php
+++ b/library/language/no/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/pl/main.php b/library/language/pl/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/pl/main.php
+++ b/library/language/pl/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/pt/main.php b/library/language/pt/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/pt/main.php
+++ b/library/language/pt/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/ro/main.php b/library/language/ro/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/ro/main.php
+++ b/library/language/ro/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/sk/main.php b/library/language/sk/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/sk/main.php
+++ b/library/language/sk/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/sl/main.php b/library/language/sl/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/sl/main.php
+++ b/library/language/sl/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/source/main.php b/library/language/source/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/source/main.php
+++ b/library/language/source/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/sq/main.php b/library/language/sq/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/sq/main.php
+++ b/library/language/sq/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/sr/main.php b/library/language/sr/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/sr/main.php
+++ b/library/language/sr/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/sv/main.php b/library/language/sv/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/sv/main.php
+++ b/library/language/sv/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/tg/main.php b/library/language/tg/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/tg/main.php
+++ b/library/language/tg/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/th/main.php b/library/language/th/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/th/main.php
+++ b/library/language/th/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/tk/main.php b/library/language/tk/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/tk/main.php
+++ b/library/language/tk/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/tlh/main.php b/library/language/tlh/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/tlh/main.php
+++ b/library/language/tlh/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/tr/main.php b/library/language/tr/main.php
index 7bb1fa6a7..06fb5f9f6 100644
--- a/library/language/tr/main.php
+++ b/library/language/tr/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/tt/main.php b/library/language/tt/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/tt/main.php
+++ b/library/language/tt/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/uk/main.php b/library/language/uk/main.php
index b6547a0bb..dbed278a1 100644
--- a/library/language/uk/main.php
+++ b/library/language/uk/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Відновити';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Редагувати завдання';
$lang['CRON_EDIT_HEAD_ADD'] = 'Додати завдання';
-$lang['CRON_SCRIPT_EXPL'] = 'назва в папці "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'назва в папці "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Оберить запуск',
'hourly' => 'щогодини',
diff --git a/library/language/uz/main.php b/library/language/uz/main.php
index f952eda99..c74360435 100644
--- a/library/language/uz/main.php
+++ b/library/language/uz/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/vi/main.php b/library/language/vi/main.php
index 8963c5e6c..ce85bdf40 100644
--- a/library/language/vi/main.php
+++ b/library/language/vi/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/library/language/zh/main.php b/library/language/zh/main.php
index 5a53187e5..a558f7c26 100644
--- a/library/language/zh/main.php
+++ b/library/language/zh/main.php
@@ -2422,7 +2422,7 @@ $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
-$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
+$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
$lang['SCHEDULE'] = array(
'select' => '» Select start',
'hourly' => 'hourly',
diff --git a/login.php b/login.php
index 4eff364df..f5222e9ca 100644
--- a/login.php
+++ b/login.php
@@ -48,7 +48,7 @@ $login_errors = array();
if (preg_match('/^redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si', $_SERVER['QUERY_STRING'], $matches)) {
$redirect_url = $matches[1];
- if (!strstr($redirect_url, '?') && $first_amp = strpos($redirect_url, '&')) {
+ if (false === strpos($redirect_url, '?') && $first_amp = strpos($redirect_url, '&')) {
$redirect_url[$first_amp] = '?';
}
} elseif (!empty($_POST['redirect'])) {
@@ -60,7 +60,7 @@ if (preg_match('/^redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si', $_SERVER['QUERY_STRING
$redirect_url = str_replace('&admin=1', '', $redirect_url);
$redirect_url = str_replace('?admin=1', '', $redirect_url);
-if (!$redirect_url || strstr(urldecode($redirect_url), "\n") || strstr(urldecode($redirect_url), "\r") || strstr(urldecode($redirect_url), ';url')) {
+if (!$redirect_url || false !== strpos(urldecode($redirect_url), "\n") || false !== strpos(urldecode($redirect_url), "\r") || false !== strpos(urldecode($redirect_url), ';url')) {
$redirect_url = "index.php";
}
@@ -135,7 +135,7 @@ if (IS_GUEST || $mod_admin_login) {
$template->assign_vars(array(
'LOGIN_USERNAME' => htmlCHR($login_username),
'LOGIN_PASSWORD' => htmlCHR($login_password),
- 'ERROR_MESSAGE' => join('
', $login_errors),
+ 'ERROR_MESSAGE' => implode('
', $login_errors),
'ADMIN_LOGIN' => $mod_admin_login,
'REDIRECT_URL' => htmlCHR($redirect_url),
'CAPTCHA_HTML' => ($need_captcha && !$bb_cfg['captcha']['disabled']) ? bb_captcha('get') : '',
diff --git a/memberlist.php b/memberlist.php
index c84d7e6cd..794ccf1de 100644
--- a/memberlist.php
+++ b/memberlist.php
@@ -32,7 +32,7 @@ $page_cfg['use_tablesorter'] = true;
$user->session_start(array('req_login' => true));
-$start = abs(intval(request_var('start', 0)));
+$start = abs((int)request_var('start', 0));
$mode = (string)request_var('mode', 'joined');
$sort_order = (request_var('order', 'ASC') == 'ASC') ? 'ASC' : 'DESC';
$username = request_var('username', '');
@@ -64,7 +64,7 @@ $mode_types = array(
// \n\n", $topic_titles),
+ 'ITEMS_LIST' => implode("\n\n\n", $topic_titles),
'FORM_ACTION' => "modcp.php",
'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
));
@@ -305,7 +304,7 @@ switch ($mode) {
'MESSAGE_TITLE' => $lang['CONFIRM'],
'MESSAGE_TEXT' => $lang['CONFIRM_MOVE_TOPIC'],
- 'TOPIC_TITLES' => join("\n\n\n", $topic_titles),
+ 'TOPIC_TITLES' => implode("\n\n\n", $topic_titles),
'S_FORUM_SELECT' => $forum_select,
'S_MODCP_ACTION' => "modcp.php",
@@ -399,11 +398,11 @@ switch ($mode) {
if (($split || $delete_posts) && ($posts && $topic_id && $forum_id && $topic_first_post_id) && $confirmed) {
foreach ($posts as $post_id) {
- if ($pid = intval($post_id)) {
+ if ($pid = (int)$post_id) {
$req_post_id_sql[] = $pid;
}
}
- if ($req_post_id_sql = join(',', $req_post_id_sql)) {
+ if ($req_post_id_sql = implode(',', $req_post_id_sql)) {
$sql = "SELECT post_id
FROM " . BB_POSTS . "
WHERE post_id IN($req_post_id_sql)
@@ -418,7 +417,7 @@ switch ($mode) {
foreach ($rowset as $rid => $row) {
$post_id_sql[] = $row['post_id'];
}
- $post_id_sql = join(',', $post_id_sql);
+ $post_id_sql = implode(',', $post_id_sql);
}
}
}
@@ -442,8 +441,8 @@ switch ($mode) {
$user_id_sql = '';
$post_id_sql = '';
do {
- $user_id_sql .= (($user_id_sql != '') ? ', ' : '') . intval($row['poster_id']);
- $post_id_sql .= (($post_id_sql != '') ? ', ' : '') . intval($row['post_id']);
+ $user_id_sql .= (($user_id_sql != '') ? ', ' : '') . (int)$row['poster_id'];
+ $post_id_sql .= (($post_id_sql != '') ? ', ' : '') . (int)$row['post_id'];
} while ($row = DB()->sql_fetchrow($result));
$post_subject = clean_title($_POST['subject']);
@@ -451,7 +450,7 @@ switch ($mode) {
bb_die($lang['EMPTY_SUBJECT']);
}
- $new_forum_id = intval($_POST['new_forum_id']);
+ $new_forum_id = (int)$_POST['new_forum_id'];
$topic_time = TIMENOW;
$sql = 'SELECT forum_id FROM ' . BB_FORUMS . ' WHERE forum_id = ' . $new_forum_id;
diff --git a/poll.php b/poll.php
index ef634e643..79652d1de 100644
--- a/poll.php
+++ b/poll.php
@@ -34,7 +34,7 @@ $forum_id = (int)@$_POST['forum_id'];
$vote_id = (int)@$_POST['vote_id'];
$return_topic_url = TOPIC_URL . $topic_id;
-$return_topic_url .= !empty($_POST['start']) ? "&start=" . intval($_POST['start']) : '';
+$return_topic_url .= !empty($_POST['start']) ? "&start=" . (int)$_POST['start'] : '';
set_die_append_msg($forum_id, $topic_id);
@@ -169,7 +169,7 @@ class bb_poll
public $poll_votes = array();
public $max_votes = 0;
- public function bb_poll()
+ public function __construct()
{
global $bb_cfg;
$this->max_votes = $bb_cfg['max_poll_options'];
diff --git a/posting.php b/posting.php
index 6b14fc687..61e36ec14 100644
--- a/posting.php
+++ b/posting.php
@@ -241,7 +241,7 @@ if (!$is_auth[$is_auth_type]) {
}
if ($mode == 'new_rel') {
- if ($tor_status = join(',', $bb_cfg['tor_cannot_new'])) {
+ if ($tor_status = implode(',', $bb_cfg['tor_cannot_new'])) {
$sql = DB()->fetch_rowset("SELECT t.topic_title, t.topic_id, tor.tor_status
FROM " . BB_BT_TORRENTS . " tor, " . BB_TOPICS . " t
WHERE poster_id = {$userdata['user_id']}
@@ -281,7 +281,7 @@ execute_posting_attachment_handling();
$topic_has_new_posts = false;
if (!IS_GUEST && $mode != 'newtopic' && ($submit || $preview || $mode == 'quote' || $mode == 'reply') && isset($_COOKIE[COOKIE_TOPIC])) {
- if ($topic_last_read = max(intval(@$tracking_topics[$topic_id]), intval(@$tracking_forums[$forum_id]))) {
+ if ($topic_last_read = max((int)(@$tracking_topics[$topic_id]), (int)(@$tracking_forums[$forum_id]))) {
$sql = "SELECT p.*, pt.post_text, u.username, u.user_rank
FROM " . BB_POSTS . " p, " . BB_POSTS_TEXT . " pt, " . BB_USERS . " u
WHERE p.topic_id = " . (int)$topic_id . "
@@ -404,7 +404,7 @@ if (($delete || $mode == 'delete') && !$confirm) {
}
}
$sub_forums[] = $forum_id;
- $sub_forums = join(',', $sub_forums);
+ $sub_forums = implode(',', $sub_forums);
// Подсчет проверенных релизов в форумах раздела
$count_checked_releases = DB()->fetch_row("
SELECT COUNT(*) AS checked_releases
@@ -643,7 +643,7 @@ $template->assign_vars(array(
'MESSAGE' => $message,
'POSTER_RGROUPS' => isset($poster_rgroups) && !empty($poster_rgroups) ? $poster_rgroups : '',
- 'ATTACH_RG_SIG' => ($switch_rg_sig) ? $switch_rg_sig : false,
+ 'ATTACH_RG_SIG' => ($switch_rg_sig) ?: false,
'U_VIEWTOPIC' => ($mode == 'reply') ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc" : '',
diff --git a/privmsg.php b/privmsg.php
index 80526f6a4..9af6369d6 100644
--- a/privmsg.php
+++ b/privmsg.php
@@ -100,10 +100,10 @@ if ($cancel) {
//
// Var definitions
//
-$start = isset($_REQUEST['start']) ? abs(intval($_REQUEST['start'])) : 0;
+$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0;
if (isset($_POST[POST_POST_URL]) || isset($_GET[POST_POST_URL])) {
- $privmsg_id = (isset($_POST[POST_POST_URL])) ? intval($_POST[POST_POST_URL]) : intval($_GET[POST_POST_URL]);
+ $privmsg_id = (isset($_POST[POST_POST_URL])) ? (int)$_POST[POST_POST_URL] : (int)$_GET[POST_POST_URL];
} else {
$privmsg_id = '';
}
@@ -126,7 +126,7 @@ $template->assign_var('POSTING_SUBJECT');
if ($mode == 'read') {
if (!empty($_GET[POST_POST_URL])) {
- $privmsgs_id = intval($_GET[POST_POST_URL]);
+ $privmsgs_id = (int)$_GET[POST_POST_URL];
} else {
bb_die($lang['NO_PM_ID']);
}
@@ -462,8 +462,8 @@ if ($mode == 'read') {
$delete_sql_id = '';
if (!$delete_all) {
- for ($i = 0; $i < count($mark_list); $i++) {
- $delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . intval($mark_list[$i]);
+ for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
+ $delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
}
$delete_sql_id = "AND privmsgs_id IN ($delete_sql_id)";
}
@@ -504,8 +504,8 @@ if ($mode == 'read') {
if (count($mark_list)) {
$delete_sql_id = '';
- for ($i = 0; $i < sizeof($mark_list); $i++) {
- $delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . intval($mark_list[$i]);
+ for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
+ $delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
}
if ($folder == 'inbox' || $folder == 'outbox') {
@@ -544,7 +544,7 @@ if ($mode == 'read') {
}
} while ($row = DB()->sql_fetchrow($result));
- if (sizeof($update_users)) {
+ if (count($update_users)) {
while (list($type, $users) = each($update_users)) {
while (list($user_id, $dec) = each($users)) {
$update_list[$type][$dec][] = $user_id;
@@ -564,7 +564,7 @@ if ($mode == 'read') {
}
while (list($dec, $user_ary) = each($dec_ary)) {
- $user_ids = join(', ', $user_ary);
+ $user_ids = implode(', ', $user_ary);
$sql = "UPDATE " . BB_USERS . "
SET $type = $type - $dec
@@ -624,7 +624,7 @@ if ($mode == 'read') {
}
}
} elseif ($save && $mark_list && $folder != 'savebox' && $folder != 'outbox') {
- if (sizeof($mark_list)) {
+ if (count($mark_list)) {
// See if recipient is at their savebox limit
$sql = "SELECT COUNT(privmsgs_id) AS savebox_items, MIN(privmsgs_date) AS oldest_post_time
FROM " . BB_PRIVMSGS . "
@@ -663,8 +663,8 @@ if ($mode == 'read') {
}
$saved_sql_id = '';
- for ($i = 0; $i < sizeof($mark_list); $i++) {
- $saved_sql_id .= (($saved_sql_id != '') ? ', ' : '') . intval($mark_list[$i]);
+ for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
+ $saved_sql_id .= (($saved_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
}
// Process request
@@ -707,7 +707,7 @@ if ($mode == 'read') {
}
} while ($row = DB()->sql_fetchrow($result));
- if (sizeof($update_users)) {
+ if (count($update_users)) {
while (list($type, $users) = each($update_users)) {
while (list($user_id, $dec) = each($users)) {
$update_list[$type][$dec][] = $user_id;
@@ -727,7 +727,7 @@ if ($mode == 'read') {
}
while (list($dec, $user_ary) = each($dec_ary)) {
- $user_ids = join(', ', $user_ary);
+ $user_ids = implode(', ', $user_ary);
$sql = "UPDATE " . BB_USERS . " SET $type = $type - $dec WHERE user_id IN ($user_ids)";
if (!DB()->sql_query($sql)) {
@@ -992,7 +992,7 @@ if ($mode == 'read') {
}
if (!empty($_GET[POST_USERS_URL])) {
- $user_id = intval($_GET[POST_USERS_URL]);
+ $user_id = (int)$_GET[POST_USERS_URL];
$sql = "SELECT username FROM " . BB_USERS . " WHERE user_id = $user_id AND user_id <> " . GUEST_UID;
if (!($result = DB()->sql_query($sql))) {
@@ -1277,7 +1277,7 @@ if ($mode == 'read') {
// Show messages over previous x days/months
//
if ($submit_msgdays && (!empty($_POST['msgdays']) || !empty($_GET['msgdays']))) {
- $msg_days = (!empty($_POST['msgdays'])) ? intval($_POST['msgdays']) : intval($_GET['msgdays']);
+ $msg_days = (!empty($_POST['msgdays'])) ? (int)$_POST['msgdays'] : (int)$_GET['msgdays'];
$min_msg_time = TIMENOW - ($msg_days * 86400);
$limit_msg_time_total = " AND privmsgs_date > $min_msg_time";
@@ -1389,7 +1389,7 @@ if ($mode == 'read') {
'INBOX_LIMIT_IMG_WIDTH' => max(4, $box_limit_img_length),
'INBOX_LIMIT_PERCENT' => $box_limit_percent,
- 'BOX_SIZE_STATUS' => ($l_box_size_status) ? $l_box_size_status : '',
+ 'BOX_SIZE_STATUS' => ($l_box_size_status) ?: '',
'L_FROM_OR_TO' => ($folder == 'inbox' || $folder == 'savebox') ? $lang['FROM'] : $lang['TO'],
diff --git a/search.php b/search.php
index 9d26308a6..389e5e081 100644
--- a/search.php
+++ b/search.php
@@ -103,7 +103,7 @@ $max_forum_name_len = 60; // inside forum select box
$text_match_max_len = 60;
$poster_name_max_len = 25;
-$start = isset($_REQUEST['start']) ? abs(intval($_REQUEST['start'])) : 0;
+$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0;
$url = basename(__FILE__);
$anon_id = GUEST_UID;
@@ -390,13 +390,13 @@ if (!$items_found) {
$forum_selected = get_id_ary($var);
if (!in_array($search_all, $forum_selected)) {
- $forum_val = join(',', $forum_selected);
+ $forum_val = implode(',', $forum_selected);
}
}
// Topic
if ($var =& $_REQUEST[$topic_key]) {
- $topic_val = join(',', get_id_ary($var));
+ $topic_val = implode(',', get_id_ary($var));
}
// Poster id (from requested name or id)
@@ -442,7 +442,7 @@ if ($dl_down_val) {
if ($dl_will_val) {
$dl_status[] = DL_STATUS_WILL;
}
-$dl_status_csv = join(',', $dl_status);
+$dl_status_csv = implode(',', $dl_status);
// Switches
$dl_search = ($dl_status && !IS_GUEST);
@@ -526,7 +526,7 @@ if ($post_mode) {
$search_match_topics_csv = '';
$title_match_topics = get_title_match_topics($text_match_sql, $forum_selected);
- if (!$search_match_topics_csv = join(',', $title_match_topics)) {
+ if (!$search_match_topics_csv = implode(',', $title_match_topics)) {
bb_die($lang['NO_SEARCH_MATCH']);
}
@@ -565,7 +565,7 @@ if ($post_mode) {
LEFT JOIN $posts_html_tbl ON(h.post_id = pt.post_id)
INNER JOIN $users_tbl ON(u.user_id = p.poster_id)
WHERE
- p.post_id IN(" . join(',', $items_display) . ")
+ p.post_id IN(" . implode(',', $items_display) . ")
$excluded_forums_sql
LIMIT $per_page
";
@@ -729,7 +729,7 @@ else {
$search_match_topics_csv = '';
$title_match_topics = get_title_match_topics($text_match_sql, $forum_selected);
- if (!$search_match_topics_csv = join(',', $title_match_topics)) {
+ if (!$search_match_topics_csv = implode(',', $title_match_topics)) {
bb_die($lang['NO_SEARCH_MATCH']);
}
@@ -787,7 +787,7 @@ else {
$SQL['LEFT JOIN'][] = BB_BT_DLSTATUS . " dl ON(dl.user_id = $user_id AND dl.topic_id = t.topic_id)";
}
- $SQL['WHERE'][] = "t.topic_id IN(" . join(',', $items_display) . ")";
+ $SQL['WHERE'][] = "t.topic_id IN(" . implode(',', $items_display) . ")";
if ($excluded_forums_csv) {
$SQL['WHERE'][] = "t.forum_id NOT IN($excluded_forums_csv)";
}
@@ -882,7 +882,7 @@ function fetch_search_ids($sql, $search_type = SEARCH_TYPE_POST)
$search_id = make_rand_str(SEARCH_ID_LENGTH);
if ($items_count > $per_page) {
- $search_array = join(',', $items_found);
+ $search_array = implode(',', $items_found);
$save_in_db = array(
'order',
diff --git a/tracker.php b/tracker.php
index 357ccfd17..e6833db62 100644
--- a/tracker.php
+++ b/tracker.php
@@ -59,7 +59,7 @@ $date_format = 'j-M-y';
$row_class_1 = 'row1';
$row_class_2 = 'row2';
-$start = isset($_REQUEST['start']) ? abs(intval($_REQUEST['start'])) : 0;
+$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0;
$set_default = isset($_GET['def']);
$user_id = $userdata['user_id'];
@@ -373,7 +373,7 @@ if (!$set_default) {
if ($req_cat_id =& $_REQUEST[$cat_key]) {
if (isset($cat_forum['c'][$req_cat_id])) {
$valid_forums = $cat_forum['c'][$req_cat_id];
- $forum_val = join(',', $valid_forums);
+ $forum_val = implode(',', $valid_forums);
}
} // Get requested forum_id(s)
elseif ($req_forums =& $_REQUEST[$forum_key]) {
@@ -381,17 +381,17 @@ if (!$set_default) {
$req_forums = (array)$req_forums;
array_deep($req_forums, 'intval');
$valid_forums = array_intersect($req_forums, $allowed_forums);
- $forum_val = join(',', $valid_forums);
+ $forum_val = implode(',', $valid_forums);
}
} elseif (isset($previous_settings[$forum_key])) {
$valid_forums = array_intersect(explode(',', $previous_settings[$forum_key]), $allowed_forums);
- $forum_val = join(',', $valid_forums);
+ $forum_val = implode(',', $valid_forums);
}
if ($forum_val && $forum_val != $search_all) {
$search_in_forums_ary = array_slice(explode(',', $forum_val), 0, $max_forums_selected);
$search_in_forums_fary = array_flip($search_in_forums_ary);
- $search_in_forums_csv = join(',', $search_in_forums_ary);
+ $search_in_forums_csv = implode(',', $search_in_forums_ary);
$forum_val = $search_in_forums_csv;
} else {
$forum_val = $search_all;
@@ -402,7 +402,7 @@ if (!$set_default) {
$req_poster_id = '';
if (isset($_GET[$poster_id_key]) && !$search_id) {
- $req_poster_id = intval($_GET[$poster_id_key]);
+ $req_poster_id = (int)$_GET[$poster_id_key];
} elseif (isset($_POST[$poster_name_key]) && !$search_id) {
if ($req_poster_name = clean_username($_POST[$poster_name_key])) {
$poster_name_sql = str_replace("\\'", "''", $req_poster_name);
@@ -416,8 +416,8 @@ if (!$set_default) {
}
}
} elseif ($search_id && $previous_settings[$poster_id_key]) {
- $poster_id_val = intval($previous_settings[$poster_id_key]);
- $poster_name_val = ($previous_settings[$poster_name_key]) ? $previous_settings[$poster_name_key] : '';
+ $poster_id_val = (int)$previous_settings[$poster_id_key];
+ $poster_name_val = ($previous_settings[$poster_name_key]) ?: '';
}
if ($req_poster_id) {
@@ -462,7 +462,7 @@ if ($dl_down_val) {
if ($dl_will_val) {
$dl_status[] = DL_STATUS_WILL;
}
-$dl_status_csv = join(',', $dl_status);
+$dl_status_csv = implode(',', $dl_status);
// Switches
$seed_exist = (bool)$seed_exist_val;
@@ -470,10 +470,10 @@ $poster_id = (bool)$poster_id_val;
$title_match = (bool)$title_match_sql;
$tor_type = (bool)$tor_type_val;
-$hide_cat = intval(!$show_cat_val);
-$hide_forum = intval(!$show_forum_val);
-$hide_author = intval(!$show_author_val);
-$hide_speed = intval(!$show_speed_val);
+$hide_cat = (int)(!$show_cat_val);
+$hide_forum = (int)(!$show_forum_val);
+$hide_author = (int)(!$show_author_val);
+$hide_speed = (int)(!$show_speed_val);
$only_new = ($new_val && !IS_GUEST);
$only_active = ($active_val || $seed_exist);
@@ -530,7 +530,7 @@ if ($allowed_forums) {
if ($title_match) {
$title_match_topics = get_title_match_topics($title_match_sql, $search_in_forums_ary);
- if (!$search_match_topics_csv = join(',', $title_match_topics)) {
+ if (!$search_match_topics_csv = implode(',', $title_match_topics)) {
$tr_error = true;
}
} else {
@@ -630,7 +630,7 @@ if ($allowed_forums) {
foreach (DB()->fetch_rowset($SQL) as $row) {
$tor_list_ary[] = $row['topic_id'];
}
- $tor_list_sql = join(',', $tor_list_ary);
+ $tor_list_sql = implode(',', $tor_list_ary);
$tor_count = count($tor_list_ary);
}
}
@@ -655,7 +655,7 @@ if ($allowed_forums) {
$tor_to_show = ($tor_count > $per_page) ? array_slice($tor_list_ary, $start, $per_page) : $tor_list_ary;
- if (!$tor_to_show = join(',', $tor_to_show)) {
+ if (!$tor_to_show = implode(',', $tor_to_show)) {
bb_die($lang['NO_SEARCH_MATCH']);
}
@@ -764,10 +764,10 @@ if ($allowed_forums) {
'TOR_SIZE' => humn_size($size),
'UL_SPEED' => $ul_sp,
'DL_SPEED' => $dl_sp,
- 'SEEDS' => ($seeds) ? $seeds : 0,
+ 'SEEDS' => ($seeds) ?: 0,
'SEEDS_TITLE' => ($seeds) ? $lang['SEEDERS'] : ($lang['SEED_NOT_SEEN'] . ":\n " . (($s_last) ? bb_date($s_last, $date_format) : $lang['NEVER'])),
- 'LEECHS' => ($leechs) ? $leechs : 0,
- 'COMPLETED' => ($compl) ? $compl : 0,
+ 'LEECHS' => ($leechs) ?: 0,
+ 'COMPLETED' => ($compl) ?: 0,
'REPLIES' => $tor['topic_replies'],
'VIEWS' => $tor['topic_views'],
'ADDED_RAW' => $tor['reg_time'],
diff --git a/viewforum.php b/viewforum.php
index 7eecb4d0e..cd020a9b6 100644
--- a/viewforum.php
+++ b/viewforum.php
@@ -42,7 +42,7 @@ $page_cfg['load_tpl_vars'] = array(
// Init request vars
$forum_id = (int)request_var('f', '');
-$start = abs(intval(request_var('start', '')));
+$start = abs((int)request_var('start', ''));
$mark_read = (request_var('mark', '') === 'topics');
$anon = GUEST_UID;
@@ -233,7 +233,7 @@ $topics_per_page = $bb_cfg['topics_per_page'];
$select_tpp = '';
if ($is_auth['auth_mod']) {
- if ($req_tpp = abs(intval(@$_REQUEST['tpp'])) and in_array($req_tpp, $bb_cfg['allowed_topics_per_page'])) {
+ if ($req_tpp = abs((int)(@$_REQUEST['tpp'])) and in_array($req_tpp, $bb_cfg['allowed_topics_per_page'])) {
$topics_per_page = $req_tpp;
}
@@ -259,7 +259,7 @@ $sel_previous_days = array(
);
if (!empty($_REQUEST['topicdays'])) {
- if ($req_topic_days = abs(intval($_REQUEST['topicdays'])) and isset($sel_previous_days[$req_topic_days])) {
+ if ($req_topic_days = abs((int)$_REQUEST['topicdays']) and isset($sel_previous_days[$req_topic_days])) {
$sql = "
SELECT COUNT(*) AS forum_topics
FROM " . BB_TOPICS . "
@@ -324,7 +324,7 @@ if ($title_match =& $_REQUEST[$title_match_key]) {
$title_match_val = clean_text_match($tmp, true, false);
$title_match_topics = get_title_match_topics($title_match_val, array(0 => $forum_id));
- if ($search_match_topics_csv = join(',', $title_match_topics)) {
+ if ($search_match_topics_csv = implode(',', $title_match_topics)) {
$title_match_sql = "AND t.topic_id IN($search_match_topics_csv)";
}
}
@@ -349,7 +349,7 @@ foreach (DB()->fetch_rowset($sql) as $row) {
}
// Titles, posters etc.
-if ($topics_csv = join(',', $topic_ids)) {
+if ($topics_csv = implode(',', $topic_ids)) {
$topic_rowset = DB()->fetch_rowset("
SELECT
t.*, t.topic_poster AS first_user_id, u1.user_rank as first_user_rank,
@@ -402,7 +402,7 @@ $u_auth[] = ($is_auth['auth_vote']) ? $lang['RULES_VOTE_CAN'] : $lang['RULES_VOT
$u_auth[] = ($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'];
$u_auth[] = ($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'];
$u_auth[] = ($is_auth['auth_mod']) ? $lang['RULES_MODERATE'] : '';
-$u_auth = join("
\n", $u_auth);
+$u_auth = implode("
\n", $u_auth);
$template->assign_vars(array(
'SHOW_JUMPBOX' => true,
diff --git a/viewtopic.php b/viewtopic.php
index 34f161b70..9cfc60f2a 100644
--- a/viewtopic.php
+++ b/viewtopic.php
@@ -40,7 +40,7 @@ $page_cfg['load_tpl_vars'] = array(
);
$newest = $next_topic_id = 0;
-$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
+$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
$topic_id = isset($_GET[POST_TOPIC_URL]) ? (int)$_GET[POST_TOPIC_URL] : 0;
$post_id = (!$topic_id && isset($_GET[POST_POST_URL])) ? (int)$_GET[POST_POST_URL] : 0;
@@ -54,7 +54,7 @@ $posts_per_page = $bb_cfg['posts_per_page'];
$select_ppp = '';
if ($userdata['session_admin']) {
- if ($req_ppp = abs(intval(@$_REQUEST['ppp'])) and in_array($req_ppp, $bb_cfg['allowed_posts_per_page'])) {
+ if ($req_ppp = abs((int)(@$_REQUEST['ppp'])) and in_array($req_ppp, $bb_cfg['allowed_posts_per_page'])) {
$posts_per_page = $req_ppp;
}
@@ -606,7 +606,7 @@ for ($i = 0; $i < $total_posts; $i++) {
$mc_comment = $postrow[$i]['mc_comment'];
$mc_user_id = profile_url(array('username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']));
- $rg_id = ($postrow[$i]['poster_rg_id']) ? $postrow[$i]['poster_rg_id'] : 0;
+ $rg_id = ($postrow[$i]['poster_rg_id']) ?: 0;
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
$rg_name = ($postrow[$i]['group_name']) ? htmlCHR($postrow[$i]['group_name']) : '';
$rg_signature = ($postrow[$i]['group_signature']) ? bbcode2html(htmlCHR($postrow[$i]['group_signature'])) : '';