*****admin/admin_board.php FIND - Line 50 $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; AFTER, ADD if ($config_name == 'cookie_name') { $cookie_name = str_replace('.', '_', $new['cookie_name']); } FIND - Line 76 $lang_select = language_select($new['default_lang'], 'default_lang', "../language"); REPLACE WITH $lang_select = language_select($new['default_lang'], 'default_lang', "language"); *****admin/admin_db_utilities.php FIND - Line 37 if(@phpversion() >= '4.0.0') { $file_uploads = @ini_get('file_uploads'); } else { $file_uploads = @get_cfg_var('file_uploads'); } if( ($file_uploads != 0 || empty($file_uploads)) && (strtolower($file_uploads) != 'off') && (@phpversion() != '4.0.4pl1') ) REPLACE WITH $file_uploads = (@phpversion() >= '4.0.0') ? @ini_get('file_uploads') : @get_cfg_var('file_uploads'); if( (empty($file_uploads) || $file_uploads != 0) && (strtolower($file_uploads) != 'off') && (@phpversion() != '4.0.4pl1') ) FIND - Line 569 // // Grab the data from the table. // $result = $db->sql_query("SELECT * FROM $table"); if (!$result) { message_die(GENERAL_ERROR, "Failed in get_table_content (select *)", "", __LINE__, __FILE__, "SELECT * FROM $table"); } if($db->sql_numrows($result) > 0) { $schema_insert = "\n#\n# Table Data for $table\n#\n"; } else { $schema_insert = ""; } $handler($schema_insert); // // Loop through the resulting rows and build the sql statement. // while ($row = $db->sql_fetchrow($result)) { $table_list = '('; $num_fields = $db->sql_numfields($result); // // Grab the list of field names. // for ($j = 0; $j < $num_fields; $j++) { $table_list .= $db->sql_fieldname($j, $result) . ', '; } // // Get rid of the last comma // $table_list = ereg_replace(', $', '', $table_list); $table_list .= ')'; // // Start building the SQL statement. // $schema_insert = "INSERT INTO $table $table_list VALUES("; // // Loop through the rows and fill in data for each column // for ($j = 0; $j < $num_fields; $j++) { if(!isset($row[$j])) REPLACE WITH // Grab the data from the table. if (!($result = $db->sql_query("SELECT * FROM $table"))) { message_die(GENERAL_ERROR, "Failed in get_table_content (select *)", "", __LINE__, __FILE__, "SELECT * FROM $table"); } // Loop through the resulting rows and build the sql statement. if ($row = $db->sql_fetchrow($result)) { $handler("\n#\n# Table Data for $table\n#\n"); $field_names = array(); // Grab the list of field names. $num_fields = $db->sql_numfields($result); $table_list = '('; for ($j = 0; $j < $num_fields; $j++) { $field_names[$j] = $db->sql_fieldname($j, $result); $table_list .= (($j > 0) ? ', ' : '') . $field_names[$j]; } $table_list .= ')'; do { // Start building the SQL statement. $schema_insert = "INSERT INTO $table $table_list VALUES("; // Loop through the rows and fill in data for each column for ($j = 0; $j < $num_fields; $j++) { $schema_insert .= ($j > 0) ? ', ' : ''; if(!isset($row[$field_names[$j]])) FIND - Line 611 $schema_insert .= ' NULL,'; } elseif ($row[$j] != '') { $schema_insert .= ' \'' . addslashes($row[$j]) . '\','; } else { $schema_insert .= '\'\','; } } // // Get rid of the the last comma. // $schema_insert = ereg_replace(',$', '', $schema_insert); $schema_insert .= ');'; // // Go ahead and send the insert statement to the handler function. // $handler(trim($schema_insert)); } REPLACE WITH $schema_insert .= 'NULL'; } elseif ($row[$field_names[$j]] != '') { $schema_insert .= '\'' . addslashes($row[$field_names[$j]]) . '\''; } else { $schema_insert .= '\'\''; } } $schema_insert .= ');'; // Go ahead and send the insert statement to the handler function. $handler(trim($schema_insert)); } while ($row = $db->sql_fetchrow($result)); } FIND - Line 660 if( SQL_LAYER == 'oracle' || SQL_LAYER == 'odbc' || SQL_LAYER == 'mssql' ) { switch(SQL_LAYER) { case 'oracle': $db_type = "Oracle"; break; case 'odbc': $db_type = "ODBC"; break; case 'mssql': $db_type = "MSSQL"; break; } REPLACE WITH $error = false; switch(SQL_LAYER) { case 'oracle': $error = true; break; case 'db2': $error = true; break; case 'msaccess': $error = true; break; case 'mssql': case 'mssql-odbc': $error = true; break; } if ($error) { FIND - Line 693 $template->pparse("body"); break; } REPLACE WITH Code: $template->pparse("body"); include('./page_footer_admin.'.$phpEx); } FIND - Line 763 "META" => "", REPLACE WITH "META" => '', FIND - Line 819 if(SQL_LAYER != 'mysql4') { $table_def_function = "get_table_def_" . SQL_LAYER; $table_content_function = "get_table_content_" . SQL_LAYER; } else { $table_def_function = "get_table_def_mysql"; $table_content_function = "get_table_content_mysql"; REPLACE WITH switch (SQL_LAYER) { case 'postgresql': $table_def_function = "get_table_def_postgresql"; $table_content_function = "get_table_content_postgresql"; break; case 'mysql': case 'mysql4': $table_def_function = "get_table_def_mysql"; $table_content_function = "get_table_content_mysql"; break; FIND - Line 906 if( file_exists($backup_file_tmpname) ) REPLACE WITH if( file_exists(phpbb_realpath($backup_file_tmpname)) ) *****admin/admin_disallow.php FIND - Line 44 $disallowed_user = ( isset($HTTP_POST_VARS['disallowed_user']) ) ? $HTTP_POST_VARS['disallowed_user'] : $HTTP_GET_VARS['disallowed_user']; REPLACE WITH $disallowed_user = ( isset($HTTP_POST_VARS['disallowed_user']) ) ? trim($HTTP_POST_VARS['disallowed_user']) : trim($HTTP_GET_VARS['disallowed_user']); if ($disallowed_user == '') { message_die(MESSAGE, $lang['Fields_empty']); } *****admin/admin_forum_prune.php FIND - Line 171 $prune_data .= ' ' . $lang['Days']; $hidden_input = ''; REPLACE WITH $prune_data .= ' ' . $lang['Days']; $hidden_input = ''; *****admin/admin_forums.php FIND - Line 46 "auth_sticky" => AUTH_REG, REPLACE WITH "auth_sticky" => AUTH_MOD, FIND - Line 304 $catlist = get_list('category', $cat_id, TRUE); $forumstatus == ( FORUM_LOCKED ) ? $forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\""; AFTER, ADD // These two options ($lang['Status_unlocked'] and $lang['Status_locked']) seem to be missing from // the language files. $lang['Status_unlocked'] = isset($lang['Status_unlocked']) ? $lang['Status_unlocked'] : 'Unlocked'; $lang['Status_locked'] = isset($lang['Status_locked']) ? $lang['Status_locked'] : 'Locked'; FIND - Line 612 include($phpbb_root_path . "includes/prune.$phpEx"); prune($from_id, 0); // Delete everything from forum REPLACE WITH // Delete polls in this forum $sql = "SELECT v.vote_id FROM " . VOTE_DESC_TABLE . " v, " . TOPICS_TABLE . " t WHERE t.forum_id = $from_id AND v.topic_id = t.topic_id"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, "Couldn't obtain list of vote ids", "", __LINE__, __FILE__, $sql); } if ($row = $db->sql_fetchrow($result)) { $vote_ids = ''; do { $vote_ids = (($vote_ids != '') ? ', ' : '') . $row['vote_id']; } while ($row = $db->sql_fetchrow($result)); $sql = "DELETE FROM " . VOTE_DESC_TABLE . " WHERE vote_id IN ($vote_ids)"; $db->sql_query($sql); $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " WHERE vote_id IN ($vote_ids)"; $db->sql_query($sql); $sql = "DELETE FROM " . VOTE_USERS_TABLE . " WHERE vote_id IN ($vote_ids)"; $db->sql_query($sql); } $db->sql_freeresult($result); include($phpbb_root_path . "includes/prune.$phpEx"); prune($from_id, 0, true); // Delete everything from forum FIND - Line 679 sync('forum', $to_id); } AFTER, ADD // Alter Mod level if appropriate - 2.0.4 $sql = "SELECT ug.user_id FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug WHERE a.forum_id <> $from_id AND a.auth_mod = 1 AND ug.group_id = a.group_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain moderator list", "", __LINE__, __FILE__, $sql); } if ($row = $db->sql_fetchrow($result)) { $user_ids = ''; do { $user_ids .= (($user_ids != '') ? ', ' : '' ) . $row['user_id']; } while ($row = $db->sql_fetchrow($result)); $sql = "SELECT ug.user_id FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug WHERE a.forum_id = $from_id AND a.auth_mod = 1 AND ug.group_id = a.group_id AND ug.user_id NOT IN ($user_ids)"; if( !$result2 = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain moderator list", "", __LINE__, __FILE__, $sql); } if ($row = $db->sql_fetchrow($result2)) { $user_ids = ''; do { $user_ids .= (($user_ids != '') ? ', ' : '' ) . $row['user_id']; } while ($row = $db->sql_fetchrow($result2)); $sql = "UPDATE " . USERS_TABLE . " SET user_level = " . USER . " WHERE user_id IN ($user_ids) AND user_level <> " . ADMIN; $db->sql_query($sql); } $db->sql_freeresult($result); } $db->sql_freeresult($result2); *****admin/admin_ranks.php FIND - Line 164 } } if( $rank_id ) { REPLACE WITH } } if( $rank_id ) { if (!$special_rank) { $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } } *****admin/admin_smilies.php FIND - Line 75 if( !@is_dir($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) REPLACE WITH if( !@is_dir(phpbb_realpath($phpbb_root_path . $board_config['smilies_path'] . '/' . $file)) ) FIND - Line 242 message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql); REPLACE WITH message_die(GENERAL_ERROR, "Could not get smiley list", "", __LINE__, __FILE__, $sql); FIND - Line 402 $smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? $HTTP_POST_VARS['smile_code'] : $HTTP_GET_VARS['smile_code']; $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : $HTTP_GET_VARS['smile_url']; $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? $HTTP_POST_VARS['smile_emotion'] : $HTTP_GET_VARS['smile_emotion']; $smile_id = ( isset($HTTP_POST_VARS['smile_id']) ) ? intval($HTTP_POST_VARS['smile_id']) : intval($HTTP_GET_VARS['smile_id']); REPLACE WITH $smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? trim($HTTP_POST_VARS['smile_code']) : trim($HTTP_GET_VARS['smile_code']); $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? trim($HTTP_POST_VARS['smile_url']) : trim($HTTP_GET_VARS['smile_url']); $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? trim($HTTP_POST_VARS['smile_emotion']) : trim($HTTP_GET_VARS['smile_emotion']); $smile_id = ( isset($HTTP_POST_VARS['smile_id']) ) ? intval($HTTP_POST_VARS['smile_id']) : intval($HTTP_GET_VARS['smile_id']); // If no code was entered complain ... if ($smile_code == '' || $smile_url == '') { message_die(MESSAGE, $lang['Fields_empty']); } FIND - Line 425 $result = $db->sql_query($sql); if( !$result ) REPLACE WITH if( !($result = $db->sql_query($sql)) ) FIND - Line 448 $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : $HTTP_GET_VARS['smile_url']; $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? $HTTP_POST_VARS['smile_emotion'] : $HTTP_GET_VARS['smile_emotion']; AFTER, ADD // If no code was entered complain ... if ($smile_code == '' || $smile_url == '') { message_die(MESSAGE, $lang['Fields_empty']); } *****admin/admin_styles.php FIND - Line 46 } if( $cancel ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("admin_styles.$phpEx")); exit; REPLACE WITH } if ($cancel) { redirect('admin/' . append_sid("admin_styles.$phpEx", true)); FIND - Line 135 if( !is_file($phpbb_root_path . 'templates/' .$sub_dir) && !is_link($phpbb_root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" ) { if( @file_exists($phpbb_root_path. "templates/" . $sub_dir . "/theme_info.cfg") ) REPLACE WITH if( !is_file(phpbb_realpath($phpbb_root_path . 'templates/' .$sub_dir)) && !is_link(phpbb_realpath($phpbb_root_path . 'templates/' .$sub_dir)) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" ) { if( @file_exists(@phpbb_realpath($phpbb_root_path. "templates/" . $sub_dir . "/theme_info.cfg")) ) FIND - Line 552 if( !is_file($phpbb_root_path . 'templates/' . $file) && !is_link($phpbb_root_path . 'templates/' . $file) && $file != "." && $file != ".." && $file != "CVS" ) REPLACE WITH if( !is_file(phpbb_realpath($phpbb_root_path . 'templates/' . $file)) && !is_link(phpbb_realpath($phpbb_root_path . 'templates/' . $file)) && $file != "." && $file != ".." && $file != "CVS" ) FIND - Line 751 $download_form = '