Выпиливание неподдерживаемых типов баз данных из аттач-мода. Логирование отработки сборщика мусора, логирование отвалившейся базы. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@516 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08 2013-07-26 21:49:31 +00:00
commit 14f691992b
7 changed files with 28 additions and 57 deletions

View file

@ -76,8 +76,8 @@ class ajax_common
'manage_user' => array('admin'),
'mod_action' => array('mod'),
'topic_tpl' => array('mod'),
'group_membership' => array('mod'),
'topic_tpl' => array('mod'),
'group_membership' => array('mod'),
'post_mod_comment' => array('mod'),
'gen_passkey' => array('user'),
@ -284,7 +284,7 @@ class ajax_common
$this->send();
}
/**
/**
* Verify mod rights
*/
function verify_mod_rights ($forum_id)
@ -301,7 +301,7 @@ class ajax_common
function edit_user_profile ()
{
require(AJAX_DIR .'edit_user_profile.php');
require(AJAX_DIR .'edit_user_profile.php');
}
function change_user_rank ()
@ -327,7 +327,7 @@ class ajax_common
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> '. $ranks[$rank_id]['rank_title'] .'</b>' : $lang['SHOT_RANK'];
}
function change_user_opt ()
function change_user_opt ()
{
global $bf, $lang;
@ -353,8 +353,8 @@ class ajax_common
DB()->query("UPDATE ". BB_USERS ." SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
// Удаляем данные из кеша
cache_rm_user_sessions ($user_id);
// Удаляем данные из кеша
cache_rm_user_sessions ($user_id);
$this->response['resp_html'] = $lang['SAVED'];
}
@ -382,7 +382,7 @@ class ajax_common
else $this->ajax_die($lang['NOT_AUTHORISED']);
}
// User groups membership
// User groups membership
function group_membership ()
{
global $lang, $user;
@ -497,19 +497,19 @@ class ajax_common
}
function user_register()
{
{
require(AJAX_DIR .'user_register.php');
}
}
function mod_action()
{
function mod_action()
{
require(AJAX_DIR .'mod_action.php');
}
}
function posts()
{
function posts()
{
require(AJAX_DIR .'posts.php');
}
}
function manage_user()
{
@ -522,7 +522,7 @@ class ajax_common
}
function index_data()
{
{
require(AJAX_DIR .'index_data.php');
}
@ -569,4 +569,4 @@ class ajax_common
{
require(AJAX_DIR .'view_profile.php');
}
}
}

View file

@ -768,27 +768,13 @@ function get_var($var_name, $default, $multibyte = false)
*/
function attach_mod_sql_escape($text)
{
switch (SQL_LAYER)
if (function_exists('mysql_real_escape_string'))
{
case 'postgresql':
return pg_escape_string($text);
break;
case 'mysql':
case 'mysql4':
if (function_exists('mysql_real_escape_string'))
{
return DB()->escape_string($text);
}
else
{
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
}
break;
default:
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
break;
return DB()->escape_string($text);
}
else
{
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
}
}

View file

@ -57,7 +57,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 pre-stable';
$bb_cfg['tp_release_date'] = '27-07-2013';
$bb_cfg['tp_release_state'] = 'R515';
$bb_cfg['tp_release_state'] = 'R516';
// Database
$charset = 'utf8';

View file

@ -15,6 +15,6 @@ foreach ($gc_cache as $cache_name)
if (method_exists(CACHE($cache_name), 'gc'))
{
$changes = CACHE($cache_name)->gc();
$cron_runtime_log = date('Y-m-d H:i:s') ." -- tr -- $changes rows deleted\n";
$cron_runtime_log .= date('Y-m-d H:i:s') ." -- tr -- $changes rows deleted\n";
}
}

View file

@ -29,14 +29,6 @@ $attach_sql = join(',', $attach_sql);
if ($dead_tor_sql && $attach_sql)
{
/*
// Update topic type
DB()->query("
UPDATE ". BB_TOPICS ." SET
topic_dl_type = ". TOPIC_DL_TYPE_NORMAL ."
WHERE topic_id IN($dead_tor_sql)
");
*/
// Delete torstat
DB()->query("
DELETE FROM ". BB_BT_TORSTAT ."

View file

@ -95,6 +95,7 @@ class sql_db
{
$server = (DBG_USER) ? $this->cfg['dbhost'] : '';
header("HTTP/1.0 503 Service Unavailable");
bb_log(' ', "db_err/connect_failed_{$this->cfg['dbhost']}");
die("Could not connect to the server $server");
}

View file

@ -232,16 +232,8 @@ class report_privmsg extends report_module
function _subject_details_prepare(&$message, &$subject, $row)
{
global $bb_cfg, $userdata, $datastore;
require_once(INC_DIR . "bbcode.php");
//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
/*if ((!$bb_cfg['allow_html'] || !$userdata['user_allowhtml']) && $row['privmsgs_enable_html'])
{
$message = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
}*/
require_once(INC_DIR . "bbcode.php");
$message = bbcode2html($message);