From 9b74caa6d06bd820ee6898848757e9357b2aefd1 Mon Sep 17 00:00:00 2001 From: glix08 Date: Fri, 2 Aug 2013 20:28:44 +0000 Subject: [PATCH] r532 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Море мелких исправлений и недоработок, найденных анализатором кода. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@532 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- install/xbt/windows/htdocs/xbt_config.php | 4 +- upload/admin/admin_forumauth_list.php | 2 +- upload/admin/admin_user_search.php | 1 - upload/attach_mod/attachment_mod.php | 1 + upload/config.php | 51 +------------------ upload/develop/functions_debug.php | 19 +++---- upload/includes/bbcode.php | 19 ++++--- upload/includes/template.php | 1 + upload/includes/ucp/usercp_topic_watch.php | 5 +- .../report_hack/lang_report_general.php | 4 +- .../report_hack/lang_report_post.php | 4 +- .../report_hack/lang_report_privmsg.php | 4 +- .../report_hack/lang_report_topic.php | 4 +- .../report_hack/lang_report_user.php | 4 +- .../report_hack/lang_report_general.php | 4 +- .../report_hack/lang_report_post.php | 4 +- .../report_hack/lang_report_privmsg.php | 4 +- .../report_hack/lang_report_topic.php | 4 +- .../report_hack/lang_report_user.php | 4 +- upload/stats/tr_stats.php | 4 +- 20 files changed, 41 insertions(+), 106 deletions(-) diff --git a/install/xbt/windows/htdocs/xbt_config.php b/install/xbt/windows/htdocs/xbt_config.php index 4ceb32f6e..72402aa0d 100644 --- a/install/xbt/windows/htdocs/xbt_config.php +++ b/install/xbt/windows/htdocs/xbt_config.php @@ -1,6 +1,6 @@ + $mysql_db = 'forum'; \ No newline at end of file diff --git a/upload/admin/admin_forumauth_list.php b/upload/admin/admin_forumauth_list.php index 082c4b3cd..29d394d69 100644 --- a/upload/admin/admin_forumauth_list.php +++ b/upload/admin/admin_forumauth_list.php @@ -288,7 +288,7 @@ else ORDER BY c.cat_order"; if( !($result = DB()->sql_query($sql)) ) { - message_die(general_error, 'Could not query categories list', '', __line__, __file__, $sql); + message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } $category_rows = DB()->sql_fetchrowset($result); diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index c74c3572d..3c34e0817 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -1180,7 +1180,6 @@ else $order = 'DESC'; $o_order = 'ASC'; break; - case 'DESC': default: $o_order = 'DESC'; $order = 'ASC'; diff --git a/upload/attach_mod/attachment_mod.php b/upload/attach_mod/attachment_mod.php index 0cfb2f8af..3fa2d036c 100644 --- a/upload/attach_mod/attachment_mod.php +++ b/upload/attach_mod/attachment_mod.php @@ -20,6 +20,7 @@ if (defined('ATTACH_INSTALL')) /** * wrapper function for determining the correct language directory */ +/** @noinspection PhpInconsistentReturnPointsInspection */ function attach_mod_get_lang($language_file) { global $attach_config, $bb_cfg; diff --git a/upload/config.php b/upload/config.php index 70b390d4b..6167ab469 100644 --- a/upload/config.php +++ b/upload/config.php @@ -1,51 +1,5 @@ array('filecache', array()), 'tr_cache' => array('filecache', array()), 'session_cache' => array('filecache', array()), - 'bb_cap_sid' => array('filecache', array()), 'bb_login_err' => array('filecache', array()), ); @@ -167,7 +120,7 @@ $tr_cfg = array( 'limit_seed_ips' => 0, 'limit_leech_ips' => 0, 'tor_topic_up' => true, - 'gold_silver_enabled' => true, + 'gold_silver_enabled' => true, ); $bb_cfg['show_dl_status_in_search'] = true; diff --git a/upload/develop/functions_debug.php b/upload/develop/functions_debug.php index 69422fe36..ecc968111 100644 --- a/upload/develop/functions_debug.php +++ b/upload/develop/functions_debug.php @@ -21,15 +21,16 @@ function make_OpenInEditor_js ($file, $line) } /** -* Show source part of the file -* @param string $file Filename -* @param int $line Line to read -* @param int $prev How many lines before main line to read -* @param int $next How many lines after main line to read -* @return string -* @access public -* @package ErrorHandler -*/ + * Show source part of the file + * @param string $file Filename + * @param int $line Line to read + * @param int $prev How many lines before main line to read + * @param int $next How many lines after main line to read + * @param bool $add_view_full_link + * @return string + * @access public + * @package ErrorHandler + */ function showSource ($file, $line, $prev = 10, $next = 10, $add_view_full_link = true) { if (!(file_exists($file) && is_file($file))) diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index 2e9a4431d..4d211001a 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -291,14 +291,17 @@ function strip_quotes ($text) // ############################################################################# /** -* Strips away bbcode from a given string, leaving plain text -* -* @param string Text to be stripped of bbcode tags -* @param boolean If true, strip away quote tags AND their contents -* @param boolean If true, use the fast-and-dirty method rather than the shiny and nice method -* -* @return string -*/ + * Strips away bbcode from a given string, leaving plain text + * + * @param string Text to be stripped of bbcode tags + * @param bool $stripquotes + * @param bool $fast_and_dirty + * @param bool $showlinks + * @internal param \If $boolean true, strip away quote tags AND their contents + * @internal param \If $boolean true, use the fast-and-dirty method rather than the shiny and nice method + * + * @return string + */ function strip_bbcode ($message, $stripquotes = true, $fast_and_dirty = false, $showlinks = true) { $find = array(); diff --git a/upload/includes/template.php b/upload/includes/template.php index 37e24ae78..29f91312e 100644 --- a/upload/includes/template.php +++ b/upload/includes/template.php @@ -1073,6 +1073,7 @@ class Template { array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); $i = $is_arg_start; + break; default: $pattern = '@^ diff --git a/upload/includes/ucp/usercp_topic_watch.php b/upload/includes/ucp/usercp_topic_watch.php index 309267d47..0df654665 100644 --- a/upload/includes/ucp/usercp_topic_watch.php +++ b/upload/includes/ucp/usercp_topic_watch.php @@ -97,8 +97,7 @@ if ($watch_count > 0) else { meta_refresh(BB_ROOT, '3'); - bb_die($lang['NO_WATCHED_TOPICS']); + bb_die($lang['NO_WATCHED_TOPICS']); } -print_page('usercp_topic_watch.tpl'); -?> \ No newline at end of file +print_page('usercp_topic_watch.tpl'); \ No newline at end of file diff --git a/upload/language/lang_english/report_hack/lang_report_general.php b/upload/language/lang_english/report_hack/lang_report_general.php index e964376cd..0cd76718a 100644 --- a/upload/language/lang_english/report_hack/lang_report_general.php +++ b/upload/language/lang_english/report_hack/lang_report_general.php @@ -14,6 +14,4 @@ $lang['REPORT_TYPE'] = 'General report'; $lang['WRITE_REPORT'] = 'Write report'; $lang['WRITE_REPORT_EXPLAIN'] = 'Use this form to send a message to the team.'; -$lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to write reports.'; - -?> \ No newline at end of file +$lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to write reports.'; \ No newline at end of file diff --git a/upload/language/lang_english/report_hack/lang_report_post.php b/upload/language/lang_english/report_hack/lang_report_post.php index 0213e715c..cad530355 100644 --- a/upload/language/lang_english/report_hack/lang_report_post.php +++ b/upload/language/lang_english/report_hack/lang_report_post.php @@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report posts.'; $lang['DUPLICATE_ERROR'] = 'The selected post has already been reported.'; $lang['DELETED_ERROR'] = 'The reported post was deleted.'; -$lang['CLICK_RETURN'] = '%sClick here%s to return to the post.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sClick here%s to return to the post.'; \ No newline at end of file diff --git a/upload/language/lang_english/report_hack/lang_report_privmsg.php b/upload/language/lang_english/report_hack/lang_report_privmsg.php index f0b12777d..624962f9d 100644 --- a/upload/language/lang_english/report_hack/lang_report_privmsg.php +++ b/upload/language/lang_english/report_hack/lang_report_privmsg.php @@ -24,6 +24,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report private me $lang['DUPLICATE_ERROR'] = 'The private message has already been reported.'; $lang['DELETED_ERROR'] = 'The reported private message was deleted.'; -$lang['CLICK_RETURN'] = '%sClick here%s to return to the private message.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sClick here%s to return to the private message.'; \ No newline at end of file diff --git a/upload/language/lang_english/report_hack/lang_report_topic.php b/upload/language/lang_english/report_hack/lang_report_topic.php index 72f813895..446c82727 100644 --- a/upload/language/lang_english/report_hack/lang_report_topic.php +++ b/upload/language/lang_english/report_hack/lang_report_topic.php @@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report topics.'; $lang['DUPLICATE_ERROR'] = 'The selected topic has already been reported.'; $lang['DELETED_ERROR'] = 'The reported topic was deleted.'; -$lang['CLICK_RETURN'] = '%sClick here%s to return to the topic.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sClick here%s to return to the topic.'; \ No newline at end of file diff --git a/upload/language/lang_english/report_hack/lang_report_user.php b/upload/language/lang_english/report_hack/lang_report_user.php index 0ba6ede59..215870d70 100644 --- a/upload/language/lang_english/report_hack/lang_report_user.php +++ b/upload/language/lang_english/report_hack/lang_report_user.php @@ -18,6 +18,4 @@ $lang['WRITE_REPORT_ERROR'] = 'The selected user doesn\'t exist.'; $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report users.'; $lang['DELETED_ERROR'] = 'The selected user was deleted.'; -$lang['CLICK_RETURN'] = '%sClick here%s to return to the user\'s profile.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sClick here%s to return to the user\'s profile.'; \ No newline at end of file diff --git a/upload/language/lang_russian/report_hack/lang_report_general.php b/upload/language/lang_russian/report_hack/lang_report_general.php index eb2789aff..cf723a4b2 100644 --- a/upload/language/lang_russian/report_hack/lang_report_general.php +++ b/upload/language/lang_russian/report_hack/lang_report_general.php @@ -14,6 +14,4 @@ $lang['REPORT_TYPE'] = 'Общие нарушения'; $lang['WRITE_REPORT'] = 'Сообщить о нарушении'; $lang['WRITE_REPORT_EXPLAIN'] = 'Используйте эту форму для отправки сообщения команде администраторов и модераторов.'; -$lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщений о нарушениях.'; - -?> \ No newline at end of file +$lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщений о нарушениях.'; \ No newline at end of file diff --git a/upload/language/lang_russian/report_hack/lang_report_post.php b/upload/language/lang_russian/report_hack/lang_report_post.php index 7d18576f3..2650eedd4 100644 --- a/upload/language/lang_russian/report_hack/lang_report_post.php +++ b/upload/language/lang_russian/report_hack/lang_report_post.php @@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки $lang['DUPLICATE_ERROR'] = 'О нарушениях в выбранных сообщениях уже сообщено.'; $lang['DELETED_ERROR'] = 'Сообщение с нарушением удалено.'; -$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к сообщению в теме.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к сообщению в теме.'; \ No newline at end of file diff --git a/upload/language/lang_russian/report_hack/lang_report_privmsg.php b/upload/language/lang_russian/report_hack/lang_report_privmsg.php index 0eb936b52..76dd389c4 100644 --- a/upload/language/lang_russian/report_hack/lang_report_privmsg.php +++ b/upload/language/lang_russian/report_hack/lang_report_privmsg.php @@ -24,6 +24,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки $lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.'; $lang['DELETED_ERROR'] = 'Личное сообщение с нарушением удалено.'; -$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к личному сообщению.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к личному сообщению.'; \ No newline at end of file diff --git a/upload/language/lang_russian/report_hack/lang_report_topic.php b/upload/language/lang_russian/report_hack/lang_report_topic.php index 720aa16a0..9cc760837 100644 --- a/upload/language/lang_russian/report_hack/lang_report_topic.php +++ b/upload/language/lang_russian/report_hack/lang_report_topic.php @@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки $lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.'; $lang['DELETED_ERROR'] = 'Тема с нарушением удалена.'; -$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в тему.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в тему.'; \ No newline at end of file diff --git a/upload/language/lang_russian/report_hack/lang_report_user.php b/upload/language/lang_russian/report_hack/lang_report_user.php index fa0f75d83..833887123 100644 --- a/upload/language/lang_russian/report_hack/lang_report_user.php +++ b/upload/language/lang_russian/report_hack/lang_report_user.php @@ -18,6 +18,4 @@ $lang['WRITE_REPORT_ERROR'] = 'Выбранный пользователь не $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщения.'; $lang['DELETED_ERROR'] = 'Выбранный пользователь удален.'; -$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в профиль пользователя.'; - -?> \ No newline at end of file +$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в профиль пользователя.'; \ No newline at end of file diff --git a/upload/stats/tr_stats.php b/upload/stats/tr_stats.php index b817b43c3..b93dae284 100644 --- a/upload/stats/tr_stats.php +++ b/upload/stats/tr_stats.php @@ -30,6 +30,4 @@ foreach($sql as $i => $query) { $res = DB()->query($query) or die('Oh shit!'); $row = mysql_fetch_row($res); echo "
  • {$titles[$i]} - {$row[0]}"; -} - -?> \ No newline at end of file +} \ No newline at end of file