|
From: Josh G. <os...@us...> - 2005-01-03 21:40:56
|
Update of /cvsroot/nanuke/nanuke0.x In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689 Added Files: phpbb-patches-2004-12-12-08.07.txt phpbb-patches-2004-12-15-12.31.txt phpbb-patches-2004-12-18-0.42.txt phpbb-patches-2004-12-19-09.59.txt phpbb-patches-2004-12-21-18.06.txt phpbb-patches-2004-12-31-19.24.txt phpbb-patches-2005-1-02-19.52.txt Log Message: - More minor forum module stuff - Viewtopic print view - Report post --- NEW FILE: phpbb-patches-2004-12-15-12.31.txt --- -------------------------------------------------------- part 1 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes/mcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/includes/mcp Modified Files: mcp_front.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: mcp_front.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_front.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mcp_front.php 19 Jul 2004 20:13:16 -0000 1.3 --- mcp_front.php 15 Dec 2004 18:30:50 -0000 1.4 *************** *** 27,30 **** --- 27,33 ---- $forum_list = get_forum_list("m_approve"); $post_list = array(); + $forum_names = array(); + + $forum_id = request_var("f", 0); $template->assign_var("S_SHOW_UNAPPROVED", (!empty($forum_list)) ? true : false); *************** *** 41,44 **** --- 44,58 ---- if ($total) { + $sql = "SELECT forum_id, forum_name + FROM " . FORUMS_TABLE . " + WHERE forum_id IN (" . implode(", ", $forum_list) . ")"; + $result = $db->sql_query_limit($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row["forum_id"]] = $row["forum_name"]; + } + $db->sql_freeresult($result); + $sql = "SELECT post_id FROM " . POSTS_TABLE . " *************** *** 52,60 **** } ! $sql = "SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, f.forum_id, f.forum_name ! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u WHERE p.post_id IN (" . implode(", ", $post_list) . ") AND t.topic_id = p.topic_id - AND f.forum_id = p.forum_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC"; --- 66,73 ---- } ! $sql = "SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id ! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u WHERE p.post_id IN (" . implode(", ", $post_list) . ") AND t.topic_id = p.topic_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC"; *************** *** 68,75 **** "U_MCP_TOPIC" => $url . "&t=" . $row["topic_id"] . "&mode=topic_view", "U_FORUM" => ($row["forum_id"]) ? "viewforum." . $phpEx . $SID . "&f=" . $row["forum_id"] : "", ! "U_TOPIC" => "viewtopic." . $phpEx . $SID . "&f=" . $row["forum_id"] . "&t=" . $row["topic_id"], "U_AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? "" : "memberlist." . $phpEx . $SID . "&mode=viewprofile&u=" . $row["poster_id"], ! "FORUM_NAME" => ($row["forum_id"]) ? $row["forum_name"] : $user->lang["POST_GLOBAL"], "TOPIC_TITLE" => $row["topic_title"], "AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? (($row["post_username"]) ? $row["post_username"] : $user->lang["GUEST"]) : $row["username"], --- 81,88 ---- "U_MCP_TOPIC" => $url . "&t=" . $row["topic_id"] . "&mode=topic_view", "U_FORUM" => ($row["forum_id"]) ? "viewforum." . $phpEx . $SID . "&f=" . $row["forum_id"] : "", ! "U_TOPIC" => $nanuke_root_path . "viewtopic." . $phpEx . $SID . "&f=" . (($row["forum_id"]) ? $row["forum_id"] : $forum_id) . "&t=" . $row["topic_id"], "U_AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? "" : "memberlist." . $phpEx . $SID . "&mode=viewprofile&u=" . $row["poster_id"], ! "FORUM_NAME" => ($row["forum_id"]) ? $forum_names[$row["forum_id"]] : $user->lang["GLOBAL_ANNOUNCEMENT"], "TOPIC_TITLE" => $row["topic_title"], "AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? (($row["post_username"]) ? $row["post_username"] : $user->lang["GUEST"]) : $row["username"], -------------------------------------------------------- part 2 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/includes Modified Files: functions_admin.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -r1.89 -r1.90 *** functions_admin.php 12 Dec 2004 14:07:01 -0000 1.89 --- functions_admin.php 15 Dec 2004 18:30:48 -0000 1.90 *************** *** 320,324 **** } ! if (!count($where_ids)) { return array("topics" => 0, "posts" => 0); --- 320,324 ---- } ! if (!sizeof($where_ids)) { return array("topics" => 0, "posts" => 0); *************** *** 404,408 **** } ! if (!count($post_ids)) { return false; --- 404,408 ---- } ! if (!sizeof($post_ids)) { return false; *************** *** 658,662 **** } ! if (count($topic_ids)) { $sql = "DELETE FROM " . TOPICS_TABLE . " --- 658,662 ---- } ! if (sizeof($topic_ids)) { $sql = "DELETE FROM " . TOPICS_TABLE . " *************** *** 723,763 **** if (!$where_type) { ! // Sync all topics/forums. ! if($mode == "topic") ! { ! //This can bomb out on a large forum so we"re going to split this up. ! $batch_size = 500; ! ! //TODO: Fit this into the layout. ! print "Syncing topics, going to do this in batches (batch size = $batch_size):<br />"; ! $sql = "SELECT ! MIN(topic_id) AS topic_min, ! MAX(topic_id) AS topic_max ! FROM " . TOPICS_TABLE; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $topic_min = $row["topic_min"]; ! $topic_max = $row["topic_max"]; ! ! // Run the batches ! $batch_start = $topic_min; ! while($batch_start <= $topic_max) ! { ! if (defined("DEBUG_EXTRA")) ! { ! print "Syncing topic_id $batch_start to ". ($batch_start+$batch_size) . ". "; ! print ceil(memory_get_usage()/1024) . " KB<br />\n"; ! flush(); ! } ! sync("topic", "range", "topic_id BETWEEN $batch_start AND " . ($batch_start+$batch_size-1)); ! ! $batch_start += $batch_size; ! } ! } ! else ! { ! $where_sql = ""; ! $where_sql_and = "WHERE"; ! } } elseif ($where_type == "range") --- 723,728 ---- if (!$where_type) { ! $where_sql = ""; ! $where_sql_and = "WHERE"; } elseif ($where_type == "range") *************** *** 775,779 **** } // Limit the topics/forums we are syncing, use specific topic/forum IDs. ! // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; $where_sql_and = $where_sql . "\n\tAND"; --- 740,744 ---- } // Limit the topics/forums we are syncing, use specific topic/forum IDs. ! // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; $where_sql_and = $where_sql . "\n\tAND"; *************** *** 786,789 **** --- 751,755 ---- return; } + // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; *************** *** 853,857 **** $db->sql_freeresult(); ! if (!count($topic_ids)) { return; --- 819,823 ---- $db->sql_freeresult(); ! if (!sizeof($topic_ids)) { return; *************** *** 907,911 **** } ! if (count($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " --- 873,877 ---- } ! if (sizeof($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " *************** *** 945,949 **** } ! if (count($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 911,915 ---- } ! if (sizeof($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 997,1001 **** } ! if (count($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " --- 963,967 ---- } ! if (sizeof($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " *************** *** 1035,1039 **** } ! if (count($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1001,1005 ---- } ! if (sizeof($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1107,1111 **** // 4: Retrieve last_post infos ! if (count($post_ids)) { $sql = "SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username --- 1073,1077 ---- // 4: Retrieve last_post infos ! if (sizeof($post_ids)) { $sql = "SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username *************** *** 1165,1169 **** } ! if (count($sql)) { $sql = "UPDATE " . FORUMS_TABLE . " --- 1131,1135 ---- } ! if (sizeof($sql)) { $sql = "UPDATE " . FORUMS_TABLE . " *************** *** 1204,1212 **** // Use "t" as table alias because of the $where_sql clause ! // NOTE: "t.post_approved" in the GROUP BY is causing a major slowdown. $sql = "SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM " . POSTS_TABLE . " t $where_sql ! GROUP BY t.topic_id, t.post_approved"; $result = $db->sql_query($sql); --- 1170,1178 ---- // Use "t" as table alias because of the $where_sql clause ! // NOTE: "t.post_approved" in the GROUP BY is causing a major slowdown. $sql = "SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM " . POSTS_TABLE . " t $where_sql ! GROUP BY t.topic_id"; //, t.post_approved"; $result = $db->sql_query($sql); *************** *** 1251,1260 **** // Now we delete empty topics and orphan posts ! if (count($delete_posts)) { delete_posts("topic_id", array_keys($delete_posts), FALSE); unset($delete_posts); } ! if (!count($topic_data)) { // If we get there, topic ids were invalid or topics did not contain any posts --- 1217,1227 ---- // Now we delete empty topics and orphan posts ! if (sizeof($delete_posts)) { delete_posts("topic_id", array_keys($delete_posts), FALSE); unset($delete_posts); } ! ! if (!sizeof($topic_data)) { // If we get there, topic ids were invalid or topics did not contain any posts *************** *** 1262,1266 **** return; } ! if (count($delete_topics)) { $delete_topic_ids = array(); --- 1229,1233 ---- return; } ! if (sizeof($delete_topics)) { $delete_topic_ids = array(); *************** *** 1306,1310 **** // approved becomes unapproved, and vice-versa ! if (count($approved_unapproved_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1273,1277 ---- // approved becomes unapproved, and vice-versa ! if (sizeof($approved_unapproved_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1365,1369 **** } ! if (count($sql)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1332,1336 ---- } ! if (sizeof($sql)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1378,1382 **** // if some topics have been resync"ed then resync parent forums ! if ($resync_parents && count($resync_forums)) { sync("forum", "forum_id", $resync_forums, TRUE); --- 1345,1349 ---- // if some topics have been resync"ed then resync parent forums ! if ($resync_parents && sizeof($resync_forums)) { sync("forum", "forum_id", $resync_forums, TRUE); *************** *** 1485,1489 **** // try to keep mem. use down ! $linecount = count($lines); $in_comment = false; --- 1452,1456 ---- // try to keep mem. use down ! $linecount = sizeof($lines); $in_comment = false; *************** *** 1531,1535 **** // this is faster than calling count($oktens) every time thru the loop. ! $token_count = count($tokens); for ($i = 0; $i < $token_count; $i++) { --- 1498,1502 ---- // this is faster than calling count($oktens) every time thru the loop. ! $token_count = sizeof($tokens); for ($i = 0; $i < $token_count; $i++) { *************** *** 1838,1842 **** $db->sql_freeresult($result); ! if (count($topic_id_list)) { $topic_id_list = array_unique($topic_id_list); --- 1805,1809 ---- $db->sql_freeresult($result); ! if (sizeof($topic_id_list)) { $topic_id_list = array_unique($topic_id_list); *************** *** 1853,1857 **** if ($auth->acl_get("f_read", $row["forum_id"])) { ! // DEBUG!! $config["default_forum_id"] = 2; $is_auth[$row["topic_id"]] = ($row["forum_id"]) ? $row["forum_id"] : $config["default_forum_id"]; --- 1820,1824 ---- if ($auth->acl_get("f_read", $row["forum_id"])) { ! // DEBUG!! - global topic $config["default_forum_id"] = 2; $is_auth[$row["topic_id"]] = ($row["forum_id"]) ? $row["forum_id"] : $config["default_forum_id"]; *************** *** 1871,1876 **** } ! $sql = "SELECT COUNT(*) AS total_entries ! FROM " . LOG_TABLE . " l WHERE l.log_type = $log_type AND l.log_time >= $limit_days --- 1838,1843 ---- } ! $sql = "SELECT COUNT(l.log_id) AS total_entries ! FROM " . LOG_TABLE . " l WHERE l.log_type = $log_type AND l.log_time >= $limit_days -------------------------------------------------------- part 3 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/language/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/language/en Modified Files: mcp.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: mcp.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/language/en/mcp.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** mcp.php 4 Sep 2004 19:32:23 -0000 1.11 --- mcp.php 15 Dec 2004 18:30:50 -0000 1.12 *************** *** 70,73 **** --- 70,75 ---- "FORUM_STYLE" => "Forum Style", + "GLOBAL_ANNOUNCEMENT" => "Global Announcement", + "IP_INFO" => "IP Information", --- NEW FILE: phpbb-patches-2005-1-02-19.52.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5560/includes Modified Files: functions.php session.php Log Message: ...see if i am able to break the cookie tracking system this time. :D - made some session code updates - added new acl function (might be helpful later) Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.302 retrieving revision 1.303 diff -C2 -r1.302 -r1.303 *** functions.php 31 Dec 2004 13:58:37 -0000 1.302 --- functions.php 2 Jan 2005 19:06:44 -0000 1.303 *************** [...1054 lines suppressed...] *** 366,370 **** # -- username: Admin password: admin (change this or remove it ON #ce everything is working!) ! INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 3, 7, "Admin", 0, "21232f297a57a5a743894a0e4a801fc3", "admin@yo...", "en", 1, 1, "AA0000"); # -- bots --- 366,370 ---- # -- username: Admin password: admin (change this or remove it ON #ce everything is working!) ! INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts) VALUES (2, 3, 7, "Admin", 0, "21232f297a57a5a743894a0e4a801fc3", "admin@yo...", "en", 1, 1, "AA0000", 1); # -- bots --- NEW FILE: phpbb-patches-2004-12-18-0.42.txt --- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612 Modified Files: viewtopic.php Log Message: fix highlight issue in 2.1 Index: viewtopic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -r1.354 -r1.355 *** viewtopic.php 14 Nov 2004 17:12:07 -0000 1.354 --- viewtopic.php 18 Dec 2004 16:42:21 -0000 1.355 *************** *** 35,39 **** $update = request_var("update", false); ! $hilit_words = urldecode(request_var("hilit", "")); // Do we have a topic or post id? --- 35,39 ---- $update = request_var("update", false); ! $hilit_words = request_var("hilit", ""); // Do we have a topic or post id? *************** *** 336,344 **** if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote($word, "#")); } } ! $highlight = htmlspecialchars(urlencode($hilit_words)); } --- 336,344 ---- if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote(urlencode($word), "#")); } } ! $highlight = urlencode($hilit_words); } --- NEW FILE: phpbb-patches-2004-12-31-19.24.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes Modified Files: functions.php functions_display.php message_parser.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.301 retrieving revision 1.302 diff -C2 -r1.301 -r1.302 *** functions.php 22 Dec 2004 02:06:42 -0000 1.301 --- functions.php 31 Dec 2004 13:58:37 -0000 1.302 *************** *** 1390,1394 **** { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "mysql.php") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; --- 1390,1394 ---- { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; *************** *** 1534,1538 **** AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql, false); while ($row = $db->sql_fetchrow($result)) --- 1534,1538 ---- AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) *************** *** 1580,1583 **** --- 1580,1584 ---- $prev_session_ip = $row["session_ip"]; } + $db->sql_freeresult($result); if (!$online_userlist) Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** functions_display.php 19 Dec 2004 17:59:13 -0000 1.62 --- functions_display.php 31 Dec 2004 13:58:40 -0000 1.63 *************** *** 163,167 **** } } ! $db->sql_freeresult(); // Handle marking posts --- 163,167 ---- } } ! $db->sql_freeresult($result); // Handle marking posts Index: message_parser.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/message_parser.php,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -r1.83 -r1.84 *** message_parser.php 19 Dec 2004 17:59:13 -0000 1.83 --- message_parser.php 31 Dec 2004 13:58:41 -0000 1.84 *************** *** 235,238 **** --- 235,241 ---- } + // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results + $code = strtr($code, array_flip(get_html_translation_table(HTML_ENTITIES))); + ob_start(); highlight_string($code); Update of /cvsroot/phpbb/phpBB2/includes/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes/db Modified Files: mysql.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: mysql.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/db/mysql.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** mysql.php 30 May 2004 19:24:50 -0000 1.21 --- mysql.php 31 Dec 2004 13:58:36 -0000 1.22 *************** *** 58,64 **** } ! if (count($this->open_queries)) { ! foreach ($this->open_queries as $query_id) { @mysql_free_result($query_id); --- 58,64 ---- } ! if (sizeof($this->open_queries)) { ! foreach ($this->open_queries as $i_query_id => $query_id) { @mysql_free_result($query_id); *************** *** 112,117 **** global $cache; ! // DEBUG ! $this->sql_report("start", $query); $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; --- 112,120 ---- global $cache; ! // EXPLAIN only in extra debug mode ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("start", $query); ! } $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; *************** *** 126,145 **** } ! // DEBUG ! $this->sql_report("stop", $query); if ($cache_ttl && method_exists($cache, "sql_save")) { $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result happened within sql_save() } ! elseif (preg_match("/^SELECT/", $query)) { ! $this->open_queries[] = $this->query_result; } } ! else { - // DEBUG $this->sql_report("fromcache", $query); } --- 129,150 ---- } ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("stop", $query); ! } if ($cache_ttl && method_exists($cache, "sql_save")) { + $this->open_queries[(int) $this->query_result] = $this->query_result; $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result called within sql_save() } ! else if (strpos($query, "SELECT") !== false && $this->query_result) { ! $this->open_queries[(int) $this->query_result] = $this->query_result; } } ! else if (defined("DEBUG_EXTRA")) { $this->sql_report("fromcache", $query); } *************** *** 259,263 **** } ! if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); --- 264,270 ---- } ! // This method is called too often... do not waste memory by calling/checking unneeded things ! // if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) ! if (isset($cache->sql_rowset[$query_id])) { return $cache->sql_fetchrow($query_id); *************** *** 346,360 **** } ! if ($query_id) { ! // If it is not found within the open queries, we try to free a cached result. ;) ! if (!(array_search($query_id, $this->open_queries) > 0)) ! { ! return false; ! } ! unset($this->open_queries[array_search($query_id, $this->open_queries)]); } ! return ($query_id) ? @mysql_free_result($query_id) : false; } --- 353,363 ---- } ! if (isset($this->open_queries[(int) $query_id])) { ! unset($this->open_queries[(int) $query_id]); ! return @mysql_free_result($query_id); } ! return false; } *************** *** 368,373 **** if (!$this->return_on_error) { ! $this_page = (!empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((!empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : $_ENV["QUERY_STRING"]); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; --- 371,376 ---- if (!$this->return_on_error) { ! $this_page = (isset($_SERVER["PHP_SELF"]) && !empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((isset($_SERVER["QUERY_STRING"]) && !empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : (isset($_ENV["QUERY_STRING"]) ? $_ENV["QUERY_STRING"] : "")); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; *************** *** 389,393 **** } - // DEBUG function sql_report($mode, $query = "") { --- 392,395 ---- --- NEW FILE: phpbb-patches-2004-12-21-18.06.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19627/includes Modified Files: Tag: phpBB-2_0_0 page_tail.php Log Message: Remove version information from display Index: page_tail.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/Attic/page_tail.php,v retrieving revision 1.27.2.2 retrieving revision 1.27.2.3 diff -C2 -r1.27.2.2 -r1.27.2.3 *** page_tail.php 26 Nov 2002 11:42:12 -0000 1.27.2.2 --- page_tail.php 22 Dec 2004 02:04:00 -0000 1.27.2.3 *************** *** 36,41 **** $template->assign_vars(array( ! "PHPBB_VERSION" => "2" . $board_config["version"], ! "TRANSLATION_INFO" => ( isset($lang["TRANSLATION_INFO"]) ) ? $lang["TRANSLATION_INFO"] : "", "ADMIN_LINK" => $admin_link) ); --- 36,40 ---- $template->assign_vars(array( ! "TRANSLATION_INFO" => ( isset($lang["TRANSLATION_INFO"]) ) ? $lang["TRANSLATION_INFO"] : "", "ADMIN_LINK" => $admin_link) ); Update of /cvsroot/phpbb/phpBB2/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19799/templates/subSilver Modified Files: Tag: phpBB-2_0_0 overall_footer.tpl Log Message: Remove version information from display Index: overall_footer.tpl =================================================================== RCS file: /cvsroot/phpbb/phpBB2/templates/subSilver/Attic/overall_footer.tpl,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -r1.4.2.1 -r1.4.2.2 *** overall_footer.tpl 22 Apr 2002 17:11:37 -0000 1.4.2.1 --- overall_footer.tpl 22 Dec 2004 02:05:06 -0000 1.4.2.2 *************** *** 5,15 **** This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB 2.0. If you cannot (for good ! reason) retain the full copyright we request you at least leave in place the ! Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to http://www.phpbb.com. If you refuse ! to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> ! Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001, 2002 phpBB Group<br />{TRANSLATION_INFO}</span></div> </td> </tr> --- 5,15 ---- This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB 2.0. If you cannot (for good ! reason) retain the full copyright we request you at least leave in place the ! Powered by phpBB line, with phpBB linked to http://www.phpbb.com. If you refuse ! to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> ! Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> © 2001, 2004 phpBB Group<br />{TRANSLATION_INFO}</span></div> </td> </tr> Update of /cvsroot/phpbb/phpBB2/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20042/styles/subSilver/template Modified Files: overall_footer.html Log Message: Remove version information from display Index: overall_footer.html =================================================================== RCS file: /cvsroot/phpbb/phpBB2/styles/subSilver/template/overall_footer.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** overall_footer.html 6 Jan 2004 15:36:16 -0000 1.4 --- overall_footer.html 22 Dec 2004 02:06:30 -0000 1.5 *************** *** 7,11 **** but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line, with ! "phpBB" linked to http://www.phpbb.com. If you refuse to include even this then support on our forums may be affected. --- 7,11 ---- but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line, with ! "phpBB" linked to http://www.phpbb.com. If you refuse to include even this then support on our forums may be affected. *************** *** 17,21 **** <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> ! <span class="copyright">Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> {PHPBB_VERSION} © 2002, 2003 phpBB Group<br />{TRANSLATION_INFO}<!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> </div> --- 17,21 ---- <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> ! <span class="copyright">Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> © 2002, 2005 phpBB Group<br />{TRANSLATION_INFO}<!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> </div> Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20102/includes Modified Files: functions.php Log Message: Remove version information from display Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.300 retrieving revision 1.301 diff -C2 -r1.300 -r1.301 *** functions.php 6 Nov 2004 14:20:26 -0000 1.300 --- functions.php 22 Dec 2004 02:06:42 -0000 1.301 *************** *** 337,341 **** $result = $db->sql_query($sql); ! $right = $cat_right = $padding = 0; $padding_store = array("0" => 0); $display_jumpbox = false; --- 337,341 ---- $result = $db->sql_query($sql); ! $right = $padding = 0; $padding_store = array("0" => 0); $display_jumpbox = false; *************** *** 389,397 **** $right = $row["right_id"]; - if ($row["right_id"] - $row["left_id"] > 1) - { - $cat_right = max($cat_right, $row["right_id"]); - } - $template->assign_block_vars("jumpbox_forums", array( "FORUM_ID" => $row["forum_id"], --- 389,392 ---- *************** *** 1710,1714 **** "L_ONLINE_EXPLAIN" => $l_online_time, ! "U_PRIVATEMSGS" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=" . (($user->data["user_new_privmsg"] || $l_privmsgs_text_unread) ? "unread" : "view_messages"), "U_RETURN_INBOX" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", "U_POPUP_PM" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", --- 1705,1709 ---- "L_ONLINE_EXPLAIN" => $l_online_time, ! "U_PRIVATEMSGS" => "{$phpbb_root_path}ucp.$phpEx$SID&i=" . (($user->data["user_new_privmsg"] || $l_privmsgs_text_unread) ? "unread" : "view_messages"), "U_RETURN_INBOX" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", "U_POPUP_PM" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", *************** *** 1798,1802 **** $template->assign_vars(array( - "PHPBB_VERSION" => $config["version"], "DEBUG_OUTPUT" => (defined("DEBUG")) ? $debug_output : "", --- 1793,1796 ---- --- NEW FILE: phpbb-patches-2004-12-12-08.07.txt --- -------------------------------------------------------- part 1 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313 Modified Files: common.php download.php posting.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: common.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/common.php,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -r1.163 -r1.164 *** common.php 30 Nov 2004 11:05:23 -0000 1.163 --- common.php 12 Dec 2004 14:06:56 -0000 1.164 *************** *** 295,301 **** } - // Adjust storage path"s - $config["upload_dir"] = ($config["upload_dir"]{0} == "/" || ($config["upload_dir"]{0} != "/" && $config["upload_dir"]{1} == ":")) ? $config["upload_dir"] : $phpbb_root_path . $config["upload_dir"]; - // Handle email/cron queue. if (time() - $config["queue_interval"] >= $config["last_queue_run"] && !defined("IN_ADMIN")) --- 295,298 ---- Index: download.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/download.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** download.php 17 Sep 2004 09:11:31 -0000 1.23 --- download.php 12 Dec 2004 14:07:00 -0000 1.24 *************** *** 37,41 **** } ! $sql = "SELECT * FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; --- 37,41 ---- } ! $sql = "SELECT attach_id, in_message, post_msg_id, extension FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; *************** *** 101,104 **** --- 101,118 ---- $download_mode = (int) $extensions[$attachment["extension"]]["download_mode"]; + // Fetching filename here to prevent sniffing of filename + $sql = "SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype + FROM " . ATTACHMENTS_TABLE . " + WHERE attach_id = $download_id"; + $result = $db->sql_query_limit($sql, 1); + + if (!($attachment = $db->sql_fetchrow($result))) + { + trigger_error("ERROR_NO_ATTACHMENT"); + } + $db->sql_freeresult($result); + + $attachment["physical_filename"] = basename($attachment["physical_filename"]); + if ($thumbnail) { *************** *** 117,126 **** if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($config["upload_dir"] . "/" . $attachment["physical_filename"]); } else --- 131,140 ---- if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($phpbb_root_path . $config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($phpbb_root_path . $config["upload_dir"] . "/" . $attachment["physical_filename"]); } else *************** *** 137,143 **** function send_file_to_browser($attachment, $upload_dir, $category) { ! global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config; ! $filename = $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) --- 151,157 ---- function send_file_to_browser($attachment, $upload_dir, $category) { ! global $user, $db, $config, $phpbb_root_path; ! $filename = $phpbb_root_path . $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) *************** *** 148,152 **** // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ((!empty($HTTP_SERVER_VARS["HTTP_USER_AGENT"])) ? $HTTP_SERVER_VARS["HTTP_USER_AGENT"] : ""); if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) --- 162,166 ---- // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ""; if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) *************** *** 193,198 **** } // Now the tricky part... let"s dance - // TODO: needs a little bit more testing... seems to break on some configurations (incomplete files) header("Pragma: public"); // header("Content-Transfer-Encoding: none"); --- 207,216 ---- } + if ($config["gzip_compress"]) + { + @ob_end_clean(); + } + // Now the tricky part... let"s dance header("Pragma: public"); // header("Content-Transfer-Encoding: none"); Index: posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/posting.php,v retrieving revision 1.347 retrieving revision 1.348 diff -C2 -r1.347 -r1.348 *** posting.php 30 Oct 2004 17:04:44 -0000 1.347 --- posting.php 12 Dec 2004 14:07:00 -0000 1.348 *************** *** 911,915 **** $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id); foreach ($unset_attachments as $index) --- 911,915 ---- $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id, true); foreach ($unset_attachments as $index) *************** *** 1668,1673 **** "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => $attach_row["physical_filename"], ! "real_filename" => $attach_row["real_filename"], "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], --- 1668,1673 ---- "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => basename($attach_row["physical_filename"]), ! "real_filename" => basename($attach_row["real_filename"]), "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], -------------------------------------------------------- part 2 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes/mcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes/mcp Modified Files: mcp_main.php mcp_topic.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: mcp_main.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_main.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** mcp_main.php 6 Nov 2004 14:20:27 -0000 1.10 --- mcp_main.php 12 Dec 2004 14:07:02 -0000 1.11 *************** *** 870,875 **** "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) $attach_row["physical_filename"], ! "real_filename" => (string) $attach_row["real_filename"], "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], --- 870,875 ---- "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) basename($attach_row["physical_filename"]), ! "real_filename" => (string) basename($attach_row["real_filename"]), "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], Index: mcp_topic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_topic.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mcp_topic.php 19 Jul 2004 20:13:16 -0000 1.4 --- mcp_topic.php 12 Dec 2004 14:07:02 -0000 1.5 *************** *** 359,362 **** --- 359,368 ---- move_posts($post_id_list, $to_topic_id); + // Change topic title of first post + $sql = "UPDATE " . POSTS_TABLE . " + SET post_subject = "" . $db->sql_escape($subject) . "" + WHERE post_id = {$post_id_list[0]}"; + $db->sql_query($sql); + $success_msg = "TOPIC_SPLIT_SUCCESS"; -------------------------------------------------------- part 3 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes Modified Files: functions_admin.php functions_display.php functions_posting.php functions_privmsgs.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** functions_admin.php 10 Nov 2004 14:15:16 -0000 1.88 --- functions_admin.php 12 Dec 2004 14:07:01 -0000 1.89 *************** *** 678,682 **** global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $config["upload_dir"] . "/thumb_" . $filename : $config["upload_dir"] . "/" . $filename; $deleted = @unlink($filename); --- 678,682 ---- global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($filename) : $phpbb_root_path . $config["upload_dir"] . "/" . basename($filename); $deleted = @unlink($filename); *************** *** 685,698 **** $filesys = str_replace("/","\\", $filename); $deleted = @system("del $filesys"); - - if (file_exists($filename)) - { - $filename = realpath($filename); - @chmod($filename, 0777); - if (!($deleted = @unlink($filename))) - { - $deleted = @system("del $filename"); - } - } } --- 685,688 ---- Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** functions_display.php 13 Oct 2004 19:30:01 -0000 1.60 --- functions_display.php 12 Dec 2004 14:07:01 -0000 1.61 *************** *** 536,541 **** // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $config["upload_dir"] . "/" . $attachment["physical_filename"]; ! $thumbnail_filename = $config["upload_dir"] . "/thumb_" . $attachment["physical_filename"]; $upload_image = ""; --- 536,541 ---- // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $phpbb_root_path . $config["upload_dir"] . "/" . basename($attachment["physical_filename"]); ! $thumbnail_filename = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($attachment["physical_filename"]); $upload_image = ""; *************** *** 555,559 **** $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = $attachment["real_filename"]; $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); --- 555,559 ---- $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = basename($attachment["real_filename"]); $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); Index: functions_posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_posting.php,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -r1.127 -r1.128 *** functions_posting.php 6 Nov 2004 14:20:26 -0000 1.127 --- functions_posting.php 12 Dec 2004 14:07:01 -0000 1.128 *************** *** 134,138 **** function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db; $filedata = array(); --- 134,138 ---- function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db, $phpbb_root_path; $filedata = array(); *************** *** 145,149 **** } ! $r_file = $filename; $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; --- 145,149 ---- } ! $r_file = trim(basename($filename)); $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; *************** *** 187,190 **** --- 187,229 ---- } + $filedata["thumbnail"] = 0; + + // Prepare Values + $filedata["filetime"] = time(); + $filedata["filename"] = stripslashes($r_file); + + $filedata["destination_filename"] = strtolower($filedata["filename"]); + $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; + + $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); + + // Do we have to create a thumbnail? + if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) + { + $filedata["thumbnail"] = 1; + } + + // Descide the Upload method + $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; + $upload_mode = ($local) ? "local" : $upload_mode; + + // Ok, upload the File + $result = move_uploaded_attachment($upload_mode, $file, $filedata); + + if ($result) + { + $filedata["error"][] = $result; + $filedata["post_attach"] = false; + + return $filedata; + } + + $file = (!$local) ? $phpbb_root_path . $config["upload_dir"] . "/" . $filedata["destination_filename"] : $local_storage; + + if (!$filedata["filesize"]) + { + $filedata["filesize"] = @filesize($file); + } + // Check Image Size, if it is an image if (!$auth->acl_gets("m_", "a_") && $cat_id == ATTACHMENT_CATEGORY_IMAGE) *************** *** 198,201 **** --- 237,244 ---- $filedata["error"][] = sprintf($user->lang["ERROR_IMAGESIZE"], $config["img_max_width"], $config["img_max_height"]); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 212,215 **** --- 255,262 ---- $filedata["error"][] = sprintf($user->lang["ATTACHMENT_TOO_BIG"], $allowed_filesize, $size_lang); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 222,225 **** --- 269,276 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 227,231 **** // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) --- 278,282 ---- // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($phpbb_root_path . $config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) *************** *** 233,273 **** $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; - return $filedata; - } - } - - $filedata["thumbnail"] = 0; - - // Prepare Values - $filedata["filetime"] = time(); - $filedata["filename"] = stripslashes($r_file); ! $filedata["destination_filename"] = strtolower($filedata["filename"]); ! $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; ! ! $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); ! // Do we have to create a thumbnail ? ! if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) ! { ! $filedata["thumbnail"] = 1; } - // Descide the Upload method - $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; - $upload_mode = ($local) ? "local" : $upload_mode; - - // Ok, upload the File - $result = move_uploaded_attachment($upload_mode, $file, $filedata); - - if ($result) - { - $filedata["error"][] = $result; - $filedata["post_attach"] = false; - } return $filedata; } ! // Move/Upload File - could be used for Avatars too ? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { --- 284,299 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; ! phpbb_unlink($filedata["destination_filename"]); ! phpbb_unlink($filedata["destination_filename"], "thumbnail"); ! return $filedata; ! } } return $filedata; } ! // Move/Upload File - could be used for Avatars too? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { *************** *** 280,310 **** { case "copy": ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; --- 306,336 ---- { case "copy": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; *************** *** 313,318 **** if ($filedata["thumbnail"]) { ! $source = $config["upload_dir"] . "/" . $destination_filename; ! $destination = $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) --- 339,344 ---- if ($filedata["thumbnail"]) { ! $source = $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename; ! $destination = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) *************** *** 648,652 **** { $hidden = ""; ! $attach_row["real_filename"] = stripslashes($attach_row["real_filename"]); foreach ($attach_row as $key => $value) --- 674,678 ---- { $hidden = ""; ! $attach_row["real_filename"] = stripslashes(basename($attach_row["real_filename"])); foreach ($attach_row as $key => $value) *************** *** 655,663 **** } ! $download_link = (!$attach_row["attach_id"]) ? $config["upload_dir"] . "/" . $attach_row["physical_filename"] : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => $attach_row["real_filename"], ! "ATTACH_FILENAME" => $attach_row["physical_filename"], "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["attach_id"], --- 681,689 ---- } ! $download_link = (!$attach_row["attach_id"]) ? $phpbb_root_path . $config["upload_dir"] . "/" . basename($attach_row["physical_filename"]) : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => basename($attach_row["real_filename"]), ! "ATTACH_FILENAME" => basename($attach_row["physical_filename"]), "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["at -------------------------------------------------------- part 4 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/adm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/adm Modified Files: admin_attachments.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: admin_attachments.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/adm/admin_attachments.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** admin_attachments.php 25 Nov 2004 21:52:47 -0000 1.32 --- admin_attachments.php 12 Dec 2004 14:06:55 -0000 1.33 *************** *** 362,366 **** if ($submit && $mode == "orphan") { ! $delete_files = array_keys(request_var("delete", "")); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); --- 362,366 ---- if ($submit && $mode == "orphan") { ! $delete_files = (isset($_REQUEST["delete"])) ? array_keys(request_var("delete", "")) : array(); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); *************** *** 368,373 **** foreach ($delete_files as $delete) { ! phpbb_unlink($config["upload_dir"] . "/" . $delete); ! phpbb_unlink($config["upload_dir"] . "/thumb_" . $delete); } --- 368,373 ---- foreach ($delete_files as $delete) { ! phpbb_unlink($delete); ! phpbb_unlink($delete, "thumbnail"); } *************** *** 1187,1194 **** $attach_filelist = array(); ! $dir = @opendir($config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($config["upload_dir"] . "/" . $file) && filesize($config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; --- 1187,1194 ---- $attach_filelist = array(); ! $dir = @opendir($phpbb_root_path . $config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($phpbb_root_path . $config["upload_dir"] . "/" . $file) && filesize($phpbb_root_path . $config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; *************** *** 1242,1251 **** { $row_class = (++$i % 2 == 0) ? "row2" : "row1"; ! $filesize = @filesize($config["upload_dir"] . "/" . $file); $size_lang = ($filesize >= 1048576) ? $user->lang["MB"] : ( ($filesize >= 1024) ? $user->lang["KB"] : $user->lang["BYTES"] ); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ?> <tr> ! <td class="<?php echo $row_class; ?>"><a href="<?php echo $config["upload_dir"] . "/" . $file; ?>" class="gen" target="file"><?php echo $fil... [truncated message content] |