diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 570625cee5..f40f3cf09d 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -18,6 +18,12 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); if (isset($_GET['avatar'])) { require($phpbb_root_path . 'config.' . $phpEx); + + if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) + { + exit; + } + require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); require($phpbb_root_path . 'includes/cache.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); diff --git a/phpBB/style.php b/phpBB/style.php index 575715b605..cd9f8bd9d7 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -96,7 +96,7 @@ if ($id) $user = array('user_id' => ANONYMOUS); } - $sql = 'SELECT s.style_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path + $sql = 'SELECT s.style_id, c.theme_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i WHERE s.style_id = ' . $id . ' AND t.template_id = s.template_id @@ -198,7 +198,7 @@ if ($id) // @TODO: rewrite with the new param db functions $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE theme_id = $id"; + WHERE theme_id = {$theme['theme_id']}"; $db->sql_query($sql); $cache->destroy('sql', STYLES_THEME_TABLE);