aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-11 15:03:06 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-11 15:03:06 +0000
commitbd33acd012f96096e5ef6ba131aac0b260aea6c2 (patch)
treef4781a0c2ef33c6f54c3ab10d3e8a64c04db858c /phpBB/includes
parent2b72a95734ed6f46d8cfccbbea01132b5de37994 (diff)
downloadforums-bd33acd012f96096e5ef6ba131aac0b260aea6c2.tar
forums-bd33acd012f96096e5ef6ba131aac0b260aea6c2.tar.gz
forums-bd33acd012f96096e5ef6ba131aac0b260aea6c2.tar.bz2
forums-bd33acd012f96096e5ef6ba131aac0b260aea6c2.tar.xz
forums-bd33acd012f96096e5ef6ba131aac0b260aea6c2.zip
some fixes
git-svn-id: file:///svn/phpbb/trunk@7866 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acm/acm_file.php3
-rw-r--r--phpBB/includes/acp/acp_modules.php47
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_display.php2
4 files changed, 29 insertions, 25 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 64a85db0b0..a1734c1c55 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -269,7 +269,8 @@ class acm
$found = false;
foreach ($table as $check_table)
{
- if (strpos($check_line, $check_table . ' ') !== false)
+ // Better catch partial table names than no table names. ;)
+ if (strpos($check_line, $check_table) !== false)
{
$found = true;
break;
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 8f4b702d72..3daf5273cb 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -740,7 +740,7 @@ class acp_modules
$sql = 'SELECT left_id, right_id
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND module_id = {$module_data['parent_id']}";
+ AND module_id = " . (int) $module_data['parent_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -823,7 +823,7 @@ class acp_modules
$sql = 'UPDATE ' . MODULES_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $update_ary) . "
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND module_id = {$module_data['module_id']}";
+ AND module_id = " . (int) $module_data['module_id'];
$db->sql_query($sql);
if (!$run_inline)
@@ -856,15 +856,15 @@ class acp_modules
$sql = 'UPDATE ' . MODULES_TABLE . "
SET right_id = right_id - $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id < " . $from_data['right_id'] . "
- AND right_id > " . $from_data['right_id'];
+ AND left_id < " . (int) $from_data['right_id'] . '
+ AND right_id > ' . (int) $from_data['right_id'];
$db->sql_query($sql);
// Resync righthand side of tree
$sql = 'UPDATE ' . MODULES_TABLE . "
SET left_id = left_id - $diff, right_id = right_id - $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id > " . $from_data['right_id'];
+ AND left_id > " . (int) $from_data['right_id'];
$db->sql_query($sql);
if ($to_parent_id > 0)
@@ -875,7 +875,7 @@ class acp_modules
$sql = 'UPDATE ' . MODULES_TABLE . "
SET right_id = right_id + $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
+ AND " . (int) $to_data['right_id'] . ' BETWEEN left_id AND right_id
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
$db->sql_query($sql);
@@ -883,7 +883,7 @@ class acp_modules
$sql = 'UPDATE ' . MODULES_TABLE . "
SET left_id = left_id + $diff, right_id = right_id + $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id > " . $to_data['right_id'] . '
+ AND left_id > " . (int) $to_data['right_id'] . '
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
$db->sql_query($sql);
@@ -908,7 +908,7 @@ class acp_modules
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $diff = '+ ' . ($row['right_id'] - $from_data['left_id'] + 1);
+ $diff = '+ ' . (int) ($row['right_id'] - $from_data['left_id'] + 1);
}
$sql = 'UPDATE ' . MODULES_TABLE . "
@@ -941,6 +941,9 @@ class acp_modules
AND module_id = $module_id";
$db->sql_query($sql);
+ $row['right_id'] = (int) $row['right_id'];
+ $row['left_id'] = (int) $row['left_id'];
+
// Resync tree
$sql = 'UPDATE ' . MODULES_TABLE . "
SET right_id = right_id - $diff
@@ -976,8 +979,8 @@ class acp_modules
$sql = 'SELECT module_id, left_id, right_id, module_langname
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND parent_id = {$module_row['parent_id']}
- AND " . (($action == 'move_up') ? "right_id < {$module_row['right_id']} ORDER BY right_id DESC" : "left_id > {$module_row['left_id']} ORDER BY left_id ASC");
+ AND parent_id = " . (int) $module_row['parent_id'] . '
+ AND ' . (($action == 'move_up') ? 'right_id < ' . (int) $module_row['right_id'] . ' ORDER BY right_id DESC' : 'left_id > ' . (int) $module_row['left_id'] . ' ORDER BY left_id ASC');
$result = $db->sql_query_limit($sql, $steps);
$target = array();
@@ -1002,25 +1005,25 @@ class acp_modules
*/
if ($action == 'move_up')
{
- $left_id = $target['left_id'];
- $right_id = $module_row['right_id'];
+ $left_id = (int) $target['left_id'];
+ $right_id = (int) $module_row['right_id'];
- $diff_up = $module_row['left_id'] - $target['left_id'];
- $diff_down = $module_row['right_id'] + 1 - $module_row['left_id'];
+ $diff_up = (int) ($module_row['left_id'] - $target['left_id']);
+ $diff_down = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
- $move_up_left = $module_row['left_id'];
- $move_up_right = $module_row['right_id'];
+ $move_up_left = (int) $module_row['left_id'];
+ $move_up_right = (int) $module_row['right_id'];
}
else
{
- $left_id = $module_row['left_id'];
- $right_id = $target['right_id'];
+ $left_id = (int) $module_row['left_id'];
+ $right_id = (int) $target['right_id'];
- $diff_up = $module_row['right_id'] + 1 - $module_row['left_id'];
- $diff_down = $target['right_id'] - $module_row['right_id'];
+ $diff_up = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
+ $diff_down = (int) ($target['right_id'] - $module_row['right_id']);
- $move_up_left = $module_row['right_id'] + 1;
- $move_up_right = $target['right_id'];
+ $move_up_left = (int) ($module_row['right_id'] + 1);
+ $move_up_right = (int) $target['right_id'];
}
// Now do the dirty job
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index d4947a9ca0..5918b441d0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4298,7 +4298,7 @@ function page_footer($run_cron = true)
);
// Call cron-type script
- if (!defined('IN_CRON') && $run_cron)
+ if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
{
$cron_type = '';
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 92e636af01..626e1d6dd9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -401,7 +401,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'L_FORUM_FOLDER_ALT' => $folder_alt,
'L_MODERATOR_STR' => $l_moderator,
- 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK)) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'],
+ 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'],
'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'U_LAST_POST' => $last_post_url)
);