Выпиливание неподдерживаемых типов баз данных из аттач-мода. Логирование отработки сборщика мусора, логирование отвалившейся базы. 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

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

View file

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

View file

@ -15,6 +15,6 @@ foreach ($gc_cache as $cache_name)
if (method_exists(CACHE($cache_name), 'gc')) if (method_exists(CACHE($cache_name), 'gc'))
{ {
$changes = 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) 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 // Delete torstat
DB()->query(" DB()->query("
DELETE FROM ". BB_BT_TORSTAT ." DELETE FROM ". BB_BT_TORSTAT ."

View file

@ -95,6 +95,7 @@ class sql_db
{ {
$server = (DBG_USER) ? $this->cfg['dbhost'] : ''; $server = (DBG_USER) ? $this->cfg['dbhost'] : '';
header("HTTP/1.0 503 Service Unavailable"); header("HTTP/1.0 503 Service Unavailable");
bb_log(' ', "db_err/connect_failed_{$this->cfg['dbhost']}");
die("Could not connect to the server $server"); 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) function _subject_details_prepare(&$message, &$subject, $row)
{ {
global $bb_cfg, $userdata, $datastore; global $bb_cfg, $userdata, $datastore;
require_once(INC_DIR . "bbcode.php");
// 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);
}*/
$message = bbcode2html($message); $message = bbcode2html($message);