Фиксы найденных багов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@386 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
pherum83 2012-03-15 12:49:57 +00:00
commit 304800bcb0
7 changed files with 31 additions and 23 deletions

View file

@ -93,6 +93,7 @@ switch($this->request['type'])
case 'view_message': case 'view_message':
$message = (string) $this->request['message']; $message = (string) $this->request['message'];
if(!trim($message)) $this->ajax_die($lang['EMPTY_MESSAGE']); if(!trim($message)) $this->ajax_die($lang['EMPTY_MESSAGE']);
$message = htmlCHR($message);
$this->response['message_html'] = bbcode2html($message); $this->response['message_html'] = bbcode2html($message);
$this->response['res_id'] = @$this->request['res_id']; $this->response['res_id'] = @$this->request['res_id'];

View file

@ -367,7 +367,7 @@ class cache_memcache extends cache_common
$this->cur_query = null; $this->cur_query = null;
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -380,7 +380,7 @@ class cache_memcache extends cache_common
return ($this->connected) ? $this->memcache->get($name) : false; return ($this->connected) ? $this->memcache->get($name) : false;
} }
function set ($name, $value, $ttl = 0) function set ($name, $value, $ttl = 0, $prefix = '')
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -393,7 +393,7 @@ class cache_memcache extends cache_common
return ($this->connected) ? $this->memcache->set($name, $value, false, $ttl) : false; return ($this->connected) ? $this->memcache->set($name, $value, false, $ttl) : false;
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -701,7 +701,7 @@ class cache_redis extends cache_common
$this->cur_query = null; $this->cur_query = null;
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -714,7 +714,7 @@ class cache_redis extends cache_common
return ($this->connected) ? unserialize($this->redis->get($name)) : false; return ($this->connected) ? unserialize($this->redis->get($name)) : false;
} }
function set ($name, $value, $ttl = 0) function set ($name, $value, $ttl = 0, $prefix = '')
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -740,7 +740,7 @@ class cache_redis extends cache_common
} }
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
if (!$this->connected) $this->connect(); if (!$this->connected) $this->connect();
@ -773,7 +773,7 @@ class cache_eaccelerator extends cache_common
$this->dbg_enabled = sql_dbg_enabled(); $this->dbg_enabled = sql_dbg_enabled();
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
$this->cur_query = "cache->get('$name')"; $this->cur_query = "cache->get('$name')";
$this->debug('start'); $this->debug('start');
@ -784,7 +784,7 @@ class cache_eaccelerator extends cache_common
return eaccelerator_get($name); return eaccelerator_get($name);
} }
function set ($name, $value, $ttl = 0) function set ($name, $value, $ttl = 0, $prefix = '')
{ {
$this->cur_query = "cache->set('$name')"; $this->cur_query = "cache->set('$name')";
$this->debug('start'); $this->debug('start');
@ -795,7 +795,7 @@ class cache_eaccelerator extends cache_common
return eaccelerator_put($name, $value, $ttl); return eaccelerator_put($name, $value, $ttl);
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
$this->cur_query = "cache->rm('$name')"; $this->cur_query = "cache->rm('$name')";
$this->debug('start'); $this->debug('start');
@ -826,7 +826,7 @@ class cache_apc extends cache_common
$this->dbg_enabled = sql_dbg_enabled(); $this->dbg_enabled = sql_dbg_enabled();
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
$this->cur_query = "cache->get('$name')"; $this->cur_query = "cache->get('$name')";
$this->debug('start'); $this->debug('start');
@ -837,7 +837,7 @@ class cache_apc extends cache_common
return apc_fetch($name); return apc_fetch($name);
} }
function set ($name, $value, $ttl = 0) function set ($name, $value, $ttl = 0, $prefix = '')
{ {
$this->cur_query = "cache->set('$name')"; $this->cur_query = "cache->set('$name')";
$this->debug('start'); $this->debug('start');
@ -848,7 +848,7 @@ class cache_apc extends cache_common
return apc_store($name, $value, $ttl); return apc_store($name, $value, $ttl);
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
$this->cur_query = "cache->rm('$name')"; $this->cur_query = "cache->rm('$name')";
$this->debug('start'); $this->debug('start');
@ -879,7 +879,7 @@ class cache_xcache extends cache_common
$this->dbg_enabled = sql_dbg_enabled(); $this->dbg_enabled = sql_dbg_enabled();
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
$this->cur_query = "cache->get('$name')"; $this->cur_query = "cache->get('$name')";
$this->debug('start'); $this->debug('start');
@ -890,7 +890,7 @@ class cache_xcache extends cache_common
return xcache_get($name); return xcache_get($name);
} }
function set ($name, $value, $ttl = 0) function set ($name, $value, $ttl = 0, $prefix = '')
{ {
$this->cur_query = "cache->set('$name')"; $this->cur_query = "cache->set('$name')";
$this->debug('start'); $this->debug('start');
@ -901,7 +901,7 @@ class cache_xcache extends cache_common
return xcache_set($name, $value, $ttl); return xcache_set($name, $value, $ttl);
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
$this->cur_query = "cache->rm('$name')"; $this->cur_query = "cache->rm('$name')";
$this->debug('start'); $this->debug('start');
@ -930,7 +930,7 @@ class cache_file extends cache_common
$this->dbg_enabled = sql_dbg_enabled(); $this->dbg_enabled = sql_dbg_enabled();
} }
function get ($name) function get ($name, $get_miss_key_callback = '', $prefix = '', $ttl = 0)
{ {
$filename = $this->dir . clean_filename($name) . '.php'; $filename = $this->dir . clean_filename($name) . '.php';
@ -948,7 +948,7 @@ class cache_file extends cache_common
return (!empty($filecache['value'])) ? $filecache['value'] : false; return (!empty($filecache['value'])) ? $filecache['value'] : false;
} }
function set ($name, $value, $ttl = 86400) function set ($name, $value, $ttl = 86400, $prefix = '')
{ {
if (!function_exists('var_export')) if (!function_exists('var_export'))
{ {
@ -977,7 +977,7 @@ class cache_file extends cache_common
return (bool) file_write($filecache, $filename, false, true, true); return (bool) file_write($filecache, $filename, false, true, true);
} }
function rm ($name) function rm ($name, $prefix = '')
{ {
$filename = $this->dir . clean_filename($name) . '.php'; $filename = $this->dir . clean_filename($name) . '.php';
if (file_exists($filename)) if (file_exists($filename))

View file

@ -52,8 +52,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.4 (beta)'; $bb_cfg['tp_version'] = '2.4 (beta)';
$bb_cfg['tp_release_state'] = 'R385'; $bb_cfg['tp_release_state'] = 'R386';
$bb_cfg['tp_release_date'] = '12-03-2012'; $bb_cfg['tp_release_date'] = '15-03-2012';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';

View file

@ -785,6 +785,13 @@ function bbcode2html ($text)
{ {
$bbcode = new bbcode(); $bbcode = new bbcode();
} }
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
if ( count($orig_word) )
{
$text = preg_replace($orig_word, $replacement_word, $text);
}
return $bbcode->bbcode2html($text); return $bbcode->bbcode2html($text);
} }

View file

@ -673,4 +673,4 @@ $lang['SEED_BONUS_ADD'] = '<h4>Добавление сид бонуса</h4><h6>
$lang['SEED_BONUS_RELEASE'] = 'до N-числа релизов'; $lang['SEED_BONUS_RELEASE'] = 'до N-числа релизов';
$lang['SEED_BONUS_POINTS'] = 'бонусов в час'; $lang['SEED_BONUS_POINTS'] = 'бонусов в час';
$lang['SEED_BONUS_TOR_SIZE'] = '<h4>Минимальный размер раздачи, за который будут начисляться бонусы</h4><h6>Если хотите начислять бонусы за все раздачи, оставьте поле пустым.</h6>'; $lang['SEED_BONUS_TOR_SIZE'] = '<h4>Минимальный размер раздачи, за который будут начисляться бонусы</h4><h6>Если хотите начислять бонусы за все раздачи, оставьте поле пустым.</h6>';
$lang['SEED_BONUS_USER_REGDATA'] = '<h4>Минимальный стаж пользователя на трекере, после которого будут начисляться бонусы</h4><h6>Если хотите начислять бонусы всем пользователям, оставте поле пустым.</h6>'; $lang['SEED_BONUS_USER_REGDATA'] = '<h4>Минимальный стаж пользователя на трекере, после которого будут начисляться бонусы</h4><h6>Если хотите начислять бонусы всем пользователям, оставьте поле пустым.</h6>';

View file

@ -110,7 +110,7 @@ if (isset($report_module))
// //
if (empty($errors)) if (empty($errors))
{ {
$report_desc = DB()->escape($report_desc); $report_desc = str_replace("\'", "'", $report_desc);
$report_title = clean_title($report_title); $report_title = clean_title($report_title);
report_insert($report_module->id, $report_subject_id, $report_reason, $report_title, $report_desc, false); report_insert($report_module->id, $report_subject_id, $report_reason, $report_title, $report_desc, false);

View file

@ -877,7 +877,7 @@ $template->assign_vars(array(
'POSTER_NAME_NAME' => $poster_name_key, 'POSTER_NAME_NAME' => $poster_name_key,
'POSTER_NAME_VAL' => htmlCHR($poster_name_val), 'POSTER_NAME_VAL' => htmlCHR($poster_name_val),
'TITLE_MATCH_NAME' => $title_match_key, 'TITLE_MATCH_NAME' => $title_match_key,
'TITLE_MATCH_VAL' => $title_match_val, 'TITLE_MATCH_VAL' => htmlCHR($title_match_val),
'AJAX_TOPICS' => $user->opt_js['tr_t_ax'], 'AJAX_TOPICS' => $user->opt_js['tr_t_ax'],
'SHOW_TIME_TOPICS' => $user->opt_js['tr_t_t'], 'SHOW_TIME_TOPICS' => $user->opt_js['tr_t_t'],