From d0f2399a863c4c60cdde91d9c89a175f86b494c8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 12 Oct 2007 18:14:28 +0000 Subject: some bugfixes git-svn-id: file:///svn/phpbb/trunk@8168 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 50 ++++++++++++++++++------------------ phpBB/includes/functions_content.php | 5 ++-- phpBB/includes/mcp/mcp_forum.php | 2 +- phpBB/includes/mcp/mcp_front.php | 2 +- phpBB/includes/mcp/mcp_topic.php | 2 +- 5 files changed, 31 insertions(+), 30 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index a8fe46b8e4..9e04ede90b 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -329,7 +329,7 @@ parse_css_file = {PARSE_CSS_FILE} { // Save CSS contents $sql_ary = array( - 'theme_mtime' => @filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"), + 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"), 'theme_data' => $this->db_theme_data($theme_row) ); @@ -1307,10 +1307,10 @@ parse_css_file = {PARSE_CSS_FILE} } $sql_ary = array( - 'image_filename' => $imgfilename, - 'image_width' => $imgwidth, - 'image_height' => $imgheight, - 'image_lang' => $imglang, + 'image_filename' => (string) $imgfilename, + 'image_width' => (int) $imgwidth, + 'image_height' => (int) $imgheight, + 'image_lang' => (string) $imglang, ); // already exists @@ -1325,7 +1325,7 @@ parse_css_file = {PARSE_CSS_FILE} else if (!$imageset_data_row) { $sql_ary['image_name'] = $imgname; - $sql_ary['imageset_id'] = $imageset_id; + $sql_ary['imageset_id'] = (int) $imageset_id; $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); } @@ -2158,10 +2158,10 @@ parse_css_file = {PARSE_CSS_FILE} case 'style': $sql_ary += array( - 'template_id' => $template_id, - 'theme_id' => $theme_id, - 'imageset_id' => $imageset_id, - 'style_active' => $style_active, + 'template_id' => (int) $template_id, + 'theme_id' => (int) $theme_id, + 'imageset_id' => (int) $imageset_id, + 'style_active' => (int) $style_active, ); break; @@ -2438,11 +2438,11 @@ parse_css_file = {PARSE_CSS_FILE} // We could do this using extended inserts ... but that could be one // heck of a lot of data ... $sql_ary = array( - 'template_id' => $style_id, + 'template_id' => (int) $style_id, 'template_filename' => "$pathfile$file", 'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '', - 'template_mtime' => filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"), - 'template_data' => file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"), + 'template_mtime' => (int) filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"), + 'template_data' => (string) file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"), ); if ($mode == 'insert') @@ -2984,10 +2984,10 @@ parse_css_file = {PARSE_CSS_FILE} $sql_ary = array( 'style_name' => $name, 'style_copyright' => $copyright, - 'style_active' => $active, - 'template_id' => $style_row['template_id'], - 'theme_id' => $style_row['theme_id'], - 'imageset_id' => $style_row['imageset_id'], + 'style_active' => (int) $active, + 'template_id' => (int) $style_row['template_id'], + 'theme_id' => (int) $style_row['theme_id'], + 'imageset_id' => (int) $style_row['imageset_id'], ); $sql = 'INSERT INTO ' . STYLES_TABLE . ' @@ -3115,7 +3115,7 @@ parse_css_file = {PARSE_CSS_FILE} $sql_ary += array( 'theme_storedb' => $store_db, 'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '', - 'theme_mtime' => filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css") + 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css") ); break; @@ -3167,7 +3167,7 @@ parse_css_file = {PARSE_CSS_FILE} $image_height = $image_width = 0; } - if (strpos($key, 'img_') === 0&& $image_filename) + if (strpos($key, 'img_') === 0 && $image_filename) { $key = substr($key, 4); if (in_array($key, $imageset_definitions)) @@ -3175,9 +3175,9 @@ parse_css_file = {PARSE_CSS_FILE} $sql_ary = array( 'image_name' => $key, 'image_filename' => str_replace('{PATH}', "styles/$path/imageset/", trim($image_filename)), - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $id, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $id, 'image_lang' => '', ); $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); @@ -3223,9 +3223,9 @@ parse_css_file = {PARSE_CSS_FILE} $sql_ary = array( 'image_name' => $image_name, 'image_filename' => $image_filename, - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $id, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $id, 'image_lang' => $row['lang_dir'], ); $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 5e0780f048..cbd38cd478 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -99,11 +99,12 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, /** * Generate Jumpbox */ -function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false) +function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false) { global $config, $auth, $template, $user, $db; - if (!$config['load_jumpbox']) + // We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality) + if (!$config['load_jumpbox'] && $force_display === false) { return; } diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index cf1789b68f..5f736e62b4 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -86,7 +86,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) } } - make_jumpbox($url . "&i=$id&action=$action&mode=$mode", $forum_id . (($merge_select) ? $selected_ids : ''), false, 'm_'); + make_jumpbox($url . "&i=$id&action=$action&mode=$mode" . (($merge_select) ? $selected_ids : ''), $forum_id, false, 'm_', true); $topics_per_page = ($forum_info['forum_topics_per_page']) ? $forum_info['forum_topics_per_page'] : $config['topics_per_page']; diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 06a031c61f..d67a51cd89 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -266,7 +266,7 @@ function mcp_front_view($id, $mode, $action) } $template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx")); - make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_'); + make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_', true); } ?> \ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 9c71fbad6b..f8214e4f1b 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -93,7 +93,7 @@ function mcp_topic_view($id, $mode, $action) } // Jumpbox, sort selects and that kind of things - make_jumpbox($url . "&i=$id&mode=forum_view", $topic_info['forum_id'], false, 'm_'); + make_jumpbox($url . "&i=$id&mode=forum_view", $topic_info['forum_id'], false, 'm_', true); $where_sql = ($action == 'reports') ? 'WHERE post_reported = 1 AND ' : 'WHERE'; $sort_days = $total = 0; -- cgit v1.2.1