[Phpbb-php5mod-cvs-checkins] phpbb-php5/includes bbcode.php,1.4,1.5 constants.php,1.2,1.3 db.php,1.2
Brought to you by:
jelly_doughnut
Update of /cvsroot/phpbb-php5mod/phpbb-php5/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30886/includes Modified Files: bbcode.php constants.php db.php emailer.php functions.php functions_admin.php functions_post.php functions_search.php functions_validate.php page_header.php page_tail.php sessions.php smtp.php usercp_activate.php usercp_avatar.php usercp_register.php usercp_sendpasswd.php usercp_viewprofile.php Log Message: 2.0.18 Index: usercp_sendpasswd.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/usercp_sendpasswd.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** usercp_sendpasswd.php 8 May 2005 02:12:44 -0000 1.4 --- usercp_sendpasswd.php 31 Oct 2005 03:18:41 -0000 1.5 *************** *** 51,55 **** $user_actkey = gen_rand_string(true); $key_len = 54 - strlen($server_url); ! $key_len = ( $str_len > 6 ) ? $key_len : 6; $user_actkey = substr($user_actkey, 0, $key_len); $user_password = gen_rand_string(false); --- 51,55 ---- $user_actkey = gen_rand_string(true); $key_len = 54 - strlen($server_url); ! $key_len = ( $key_len > 6 ) ? $key_len : 6; $user_actkey = substr($user_actkey, 0, $key_len); $user_password = gen_rand_string(false); Index: functions.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/functions.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions.php 19 Jul 2005 23:31:24 -0000 1.4 --- functions.php 31 Oct 2005 03:18:41 -0000 1.5 *************** *** 514,518 **** do { ! $orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote($row['word'], '#')) . ')\b#i'; $replacement_word[] = $row['replacement']; } --- 514,518 ---- do { ! $orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i'; $replacement_word[] = $row['replacement']; } Index: smtp.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/smtp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** smtp.php 8 May 2005 02:12:44 -0000 1.2 --- smtp.php 31 Oct 2005 03:18:41 -0000 1.3 *************** *** 28,32 **** // function server_parse($socket, $response, $line = __LINE__) ! { while (substr($server_response, 3, 1) != ' ') { --- 28,33 ---- // function server_parse($socket, $response, $line = __LINE__) ! { ! $server_response = ''; while (substr($server_response, 3, 1) != ' ') { Index: page_tail.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/page_tail.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page_tail.php 22 Feb 2005 01:21:02 -0000 1.3 --- page_tail.php 31 Oct 2005 03:18:41 -0000 1.4 *************** *** 26,29 **** --- 26,31 ---- } + global $gzip_compress; + // // Show the overall footer. *************** *** 38,42 **** //'PHPBB_VERSION' => '2' . $board_config['version'], //'PHPBB5_VERSION' => '2' . $board_config['version5'], ! 'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 'ADMIN_LINK' => $admin_link) ); --- 40,44 ---- //'PHPBB_VERSION' => '2' . $board_config['version'], //'PHPBB5_VERSION' => '2' . $board_config['version5'], ! 'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''), 'ADMIN_LINK' => $admin_link) ); Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/functions_admin.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions_admin.php 29 Jul 2004 22:36:19 -0000 1.1 --- functions_admin.php 31 Oct 2005 03:18:41 -0000 1.2 *************** *** 31,37 **** $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); ! $sql = "SELECT forum_id, forum_name ! FROM " . FORUMS_TABLE . " ! ORDER BY cat_id, forum_order"; if ( !($result = $db->sql_query($sql)) ) { --- 31,38 ---- $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); ! $sql = 'SELECT f.forum_id, f.forum_name ! FROM ' . CATEGORIES_TABLE . ' c, ' . FORUMS_TABLE . ' f ! WHERE f.cat_id = c.cat_id ! ORDER BY c.cat_order, f.forum_order'; if ( !($result = $db->sql_query($sql)) ) { *************** *** 139,150 **** } ! if ( $row = $db->sql_fetchrow($result) ) { ! $sql = ( $row['total_posts'] ) ? "UPDATE " . TOPICS_TABLE . " SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . " WHERE topic_id = $id" : "DELETE FROM " . TOPICS_TABLE . " WHERE topic_id = $id"; ! if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql); } } break; } --- 140,182 ---- } ! if ($row['total_posts']) { ! // Correct the details of this topic ! $sql = 'UPDATE ' . TOPICS_TABLE . ' ! SET topic_replies = ' . ($row['total_posts'] - 1) . ', topic_first_post_id = ' . $row['first_post'] . ', topic_last_post_id = ' . $row['last_post'] . " ! WHERE topic_id = $id"; ! ! if (!$db->sql_query($sql)) { message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql); } } + else + { + // There are no replies to this topic + // Check if it is a move stub + $sql = 'SELECT topic_moved_id + FROM ' . TOPICS_TABLE . " + WHERE topic_id = $id"; + + if (!($result = $db->sql_query($sql))) + { + message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql); + } + + if ($row = $db->sql_fetchrow($result)) + { + if (!$row['topic_moved_id']) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . " WHERE topic_id = $id"; + + if (!$db->sql_query($sql)) + { + message_die(GENERAL_ERROR, 'Could not remove topic', '', __LINE__, __FILE__, $sql); + } + } + } + + $db->sql_freeresult($result); break; } Index: usercp_viewprofile.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/usercp_viewprofile.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** usercp_viewprofile.php 19 Jul 2005 23:31:25 -0000 1.5 --- usercp_viewprofile.php 31 Oct 2005 03:18:41 -0000 1.6 *************** *** 166,170 **** $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts"); ! $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>'; $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>'; --- 166,170 ---- $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts"); ! $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>'; $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>'; Index: usercp_register.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/usercp_register.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** usercp_register.php 27 Jun 2005 20:16:40 -0000 1.6 --- usercp_register.php 31 Oct 2005 03:18:41 -0000 1.7 *************** *** 151,155 **** else { ! $attachsig = ( isset($_POST['attachsig']) ) ? ( ($_POST['attachsig']) ? TRUE : 0 ) : 0; $allowhtml = ( isset($_POST['allowhtml']) ) ? ( ($_POST['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml']; --- 151,155 ---- else { ! $attachsig = ( isset($_POST['attachsig']) ) ? ( ($_POST['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig']; $allowhtml = ( isset($_POST['allowhtml']) ) ? ( ($_POST['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml']; *************** *** 198,203 **** $user_avatar_filetype = ( !empty($_FILES['avatar']['type']) ) ? $_FILES['avatar']['type'] : ''; ! $user_avatar = ( empty($user_avatar_loc) && $mode == 'editprofile' ) ? $userdata['user_avatar'] : ''; ! $user_avatar_type = ( empty($user_avatar_loc) && $mode == 'editprofile' ) ? $userdata['user_avatar_type'] : ''; if ( (isset($_POST['avatargallery']) || isset($_POST['submitavatar']) || isset($_POST['cancelavatar'])) && (!isset($_POST['submit'])) ) --- 198,203 ---- $user_avatar_filetype = ( !empty($_FILES['avatar']['type']) ) ? $_FILES['avatar']['type'] : ''; ! $user_avatar = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar'] : ''; ! $user_avatar_type = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar_type'] : ''; if ( (isset($_POST['avatargallery']) || isset($_POST['submitavatar']) || isset($_POST['cancelavatar'])) && (!isset($_POST['submit'])) ) *************** *** 528,550 **** // The users account has been deactivated, send them an email with a new activation key // ! include($phpbb_root_path . 'includes/emailer.'.$phpEx); ! $emailer = new emailer($board_config['smtp_delivery']); ! $emailer->from($board_config['board_email']); ! $emailer->replyto($board_config['board_email']); ! $emailer->use_template('user_activate', stripslashes($user_lang)); ! $emailer->email_address($email); ! $emailer->set_subject($lang['Reactivate']); ! $emailer->assign_vars(array( ! 'SITENAME' => $board_config['sitename'], ! 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)), ! 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', ! 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey) ! ); ! $emailer->send(); ! $emailer->reset(); $message = $lang['Profile_updated_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); --- 528,581 ---- // The users account has been deactivated, send them an email with a new activation key // ! if ( $board_config['require_activation'] != USER_ACTIVATION_ADMIN ) ! { ! $emailer->from($board_config['board_email']); ! $emailer->replyto($board_config['board_email']); ! $emailer->use_template('user_activate', stripslashes($user_lang)); ! $emailer->email_address($email); ! $emailer->set_subject($lang['Reactivate']); ! $emailer->assign_vars(array( ! 'SITENAME' => $board_config['sitename'], ! 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)), ! 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', ! 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey) ! ); ! $emailer->send(); ! $emailer->reset(); ! } ! else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN ) ! { ! $sql = 'SELECT user_email, user_lang ! FROM ' . USERS_TABLE . ' ! WHERE user_level = ' . ADMIN; ! ! if ( !($result = $db->sql_query($sql)) ) ! { ! message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql); ! } ! ! while ($row = $db->sql_fetchrow($result)) ! { ! $emailer->from($board_config['board_email']); ! $emailer->replyto($board_config['board_email']); ! ! $emailer->email_address(trim($row['user_email'])); ! $emailer->use_template("admin_activate", $row['user_lang']); ! $emailer->set_subject($lang['Reactivate']); ! $emailer->assign_vars(array( ! 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)), ! 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']), ! ! 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey) ! ); ! $emailer->send(); ! $emailer->reset(); ! } ! $db->sql_freeresult($result); ! } $message = $lang['Profile_updated_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); *************** *** 817,821 **** $allowviewonline = !$allowviewonline; ! display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']); } else --- 848,852 ---- $allowviewonline = !$allowviewonline; ! display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $new_password, $cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']); } else *************** *** 828,834 **** } ! if ( !isset($user_template) ) { ! $selected_template = $board_config['system_template']; } --- 859,865 ---- } ! if ( !isset($user_style) ) { ! $user_style = $board_config['system_template']; } Index: functions_post.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/functions_post.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_post.php 20 Nov 2004 01:01:11 -0000 1.2 --- functions_post.php 31 Oct 2005 03:18:41 -0000 1.3 *************** *** 122,126 **** // Prepare a message for posting // ! function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length) { global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path; --- 122,126 ---- // Prepare a message for posting // ! function prepare_post($mode, $post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, $poll_options, &$poll_length) { global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path; *************** *** 579,592 **** $current_time = time(); ! if ($mode == 'delete') ! { ! $delete_sql = (!$post_data['first_post'] && !$post_data['last_post']) ? " AND user_id = " . $userdata['user_id'] : ''; ! $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql; ! if (!$db->sql_query($sql)) ! { ! message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql); ! } ! } ! else { if ($mode == 'reply') --- 579,583 ---- $current_time = time(); ! if ($mode != 'delete') { if ($mode == 'reply') *************** *** 770,774 **** $gen_simple_header = TRUE; ! $page_title = $lang['Emoticons'] . " - $topic_title"; include($phpbb_root_path . 'includes/page_header.'.$phpEx); --- 761,765 ---- $gen_simple_header = TRUE; ! $page_title = $lang['Emoticons']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); Index: db.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/db.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db.php 24 Sep 2004 02:28:03 -0000 1.2 --- db.php 31 Oct 2005 03:18:41 -0000 1.3 *************** *** 66,71 **** if(!$db->db_connect_id) { ! message_die(CRITICAL_ERROR, "Could not connect to the database"); } ! ?> --- 66,71 ---- if(!$db->db_connect_id) { ! message_die(CRITICAL_ERROR, "Could not connect to the database"); } ! ?> \ No newline at end of file Index: usercp_avatar.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/usercp_avatar.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** usercp_avatar.php 19 Jul 2005 23:31:25 -0000 1.5 --- usercp_avatar.php 31 Oct 2005 03:18:41 -0000 1.6 *************** *** 65,80 **** } ! function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename) { global $board_config; ! $avatar_filename = str_replace(array('../', '..\\', './', '.\\'), '', $avatar_filename); ! if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\") { return ''; } ! if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') ) { ! $return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY; } else --- 65,88 ---- } ! function user_avatar_galleryfunction user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename, $avatar_category) { global $board_config; ! $avatar_filename = phpbb_ltrim(basename($avatar_filename), "'"); ! $avatar_category = phpbb_ltrim(basename($avatar_category), "'"); ! ! if(!preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $avatar_filename)) { return ''; } ! ! if ($avatar_filename == "" || $avatar_category == "") { ! return ''; ! } ! ! if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_category . '/' . $avatar_filename)) && ($mode == 'editprofile') ) ! { ! $return = ", user_avatar = '" . str_replace("\'", "''", $avatar_category . '/' . $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY; } else *************** *** 111,114 **** --- 119,125 ---- $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; + $width = $height = 0; + $type = ''; + if ( $avatar_mode == 'remote' && preg_match('/^(http:\/\/)?([\w\-\.]+)\:?([0-9]*)\/(.*)$/', $avatar_filename, $url_ary) ) { *************** *** 168,172 **** } ! list($width, $height) = @getimagesize($tmp_filename); } else --- 179,183 ---- } ! list($width, $height, $type) = @getimagesize($tmp_filename); } else *************** *** 194,198 **** } ! list($width, $height) = @getimagesize($avatar_filename); } --- 205,209 ---- } ! list($width, $height, $type) = @getimagesize($avatar_filename); } *************** *** 202,205 **** --- 213,254 ---- } + switch ($type) + { + // GIF + case 1: + if ($imgtype != '.gif') + { + @unlink($tmp_filename); + message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); + } + break; + + // JPG, JPC, JP2, JPX, JB2 + case 2: + case 9: + case 10: + case 11: + case 12: + if ($imgtype != '.jpg' && $imgtype != '.jpeg') + { + @unlink($tmp_filename); + message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); + } + break; + + // PNG + case 3: + if ($imgtype != '.png') + { + @unlink($tmp_filename); + message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); + } + break; + + default: + @unlink($tmp_filename); + message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); + } + if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] ) { *************** *** 208,215 **** if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' ) { ! if ( file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $current_avatar)) ) ! { ! @unlink('./' . $board_config['avatar_path'] . '/' . $current_avatar); ! } } --- 257,261 ---- if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' ) { ! user_avatar_delete($current_type, $current_avatar); } *************** *** 279,283 **** if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) ) { ! $avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file; $avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file))); --- 325,329 ---- if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) ) { ! $avatar_images[$file][$avatar_row_count][$avatar_col_count] = $sub_file; $avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file))); *************** *** 325,329 **** { $template->assign_block_vars('avatar_row.avatar_column', array( ! "AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $avatar_images[$category][$i][$j], "AVATAR_NAME" => $avatar_name[$category][$i][$j]) ); --- 371,375 ---- { $template->assign_block_vars('avatar_row.avatar_column', array( ! "AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_images[$category][$i][$j], "AVATAR_NAME" => $avatar_name[$category][$i][$j]) ); *************** *** 337,341 **** $params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat'); ! $s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" />'; for($i = 0; $i < count($params); $i++) --- 383,387 ---- $params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat'); ! $s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="avatarcatname" value="' . $category . '" />'; for($i = 0; $i < count($params); $i++) Index: functions_validate.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/functions_validate.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_validate.php 19 Jul 2005 23:31:24 -0000 1.2 --- functions_validate.php 31 Oct 2005 03:18:41 -0000 1.3 *************** *** 35,43 **** $sql = "SELECT username ! FROM " . USERS_TABLE . " WHERE LOWER(username) = '" . strtolower($username) . "'"; if ($result = $db->sql_query($sql)) { ! if ($row = $db->sql_fetchrow($result)) { if (($userdata['session_logged_in'] && $row['username'] != $userdata['username']) || !$userdata['session_logged_in']) --- 35,43 ---- $sql = "SELECT username ! FROM " . USERS_TABLE . " WHERE LOWER(username) = '" . strtolower($username) . "'"; if ($result = $db->sql_query($sql)) { ! while ($row = $db->sql_fetchrow($result)) { if (($userdata['session_logged_in'] && $row['username'] != $userdata['username']) || !$userdata['session_logged_in']) *************** *** 71,75 **** do { ! if (preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['disallow_username'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); --- 71,75 ---- do { ! if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); *************** *** 90,94 **** do { ! if (preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['word'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); --- 90,94 ---- do { ! if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); Index: emailer.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/emailer.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** emailer.php 29 Jul 2004 22:36:19 -0000 1.1 --- emailer.php 31 Oct 2005 03:18:41 -0000 1.2 *************** *** 165,169 **** { $this->subject = (trim($match[2]) != '') ? trim($match[2]) : (($this->subject != '') ? $this->subject : 'No Subject'); ! $drop_header .= '[\r\n]*?' . phpbb_preg_quote($match[1], '#'); } else --- 165,169 ---- { $this->subject = (trim($match[2]) != '') ? trim($match[2]) : (($this->subject != '') ? $this->subject : 'No Subject'); ! $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#'); } else *************** *** 175,179 **** { $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($lang['ENCODING']); ! $drop_header .= '[\r\n]*?' . phpbb_preg_quote($match[1], '#'); } else --- 175,179 ---- { $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($lang['ENCODING']); ! $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#'); } else *************** *** 262,266 **** // remove trailing spacer and add start and end delimiters ! $str = preg_replace('#' . phpbb_preg_quote($spacer, '#') . '$#', '', $str); return $start . $str . $end; --- 262,266 ---- // remove trailing spacer and add start and end delimiters ! $str = preg_replace('#' . preg_quote($spacer, '#') . '$#', '', $str); return $start . $str . $end; Index: sessions.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/sessions.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sessions.php 19 Jul 2005 23:31:24 -0000 1.8 --- sessions.php 31 Oct 2005 03:18:41 -0000 1.9 *************** *** 57,127 **** $last_visit = 0; $current_time = time(); ! $expiry_time = $current_time - $board_config['session_length']; // ! // Try and pull the last time stored in a cookie, if it exists // ! $sql = "SELECT * ! FROM " . USERS_TABLE . " ! WHERE user_id = $user_id"; ! if ( !($result = $db->sql_query($sql)) ) { ! message_die(CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql); } ! $userdata = $db->sql_fetchrow($result); ! if ( $user_id != ANONYMOUS ) { ! $auto_login_key = $userdata['user_password']; ! ! if ( $auto_create ) { ! if ( isset($sessiondata['autologinid']) && $userdata['user_active'] ) { ! // We have to login automagically ! if( $sessiondata['autologinid'] === $auto_login_key ) ! { ! // autologinid matches password ! $login = 1; ! $enable_autologin = 1; ! } ! else ! { ! // No match; don't login, set as anonymous user ! $login = 0; ! $enable_autologin = 0; ! $user_id = $userdata['user_id'] = ANONYMOUS; ! ! $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; ! $result = $db->sql_query($sql); ! $userdata = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! } } - else - { - // Autologin is not set. Don't login, set as anonymous user - $login = 0; - $enable_autologin = 0; - $user_id = $userdata['user_id'] = ANONYMOUS; ! $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; ! $result = $db->sql_query($sql); ! $userdata = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! } } ! else { $login = 1; } } ! else { ! $login = 0; ! $enable_autologin = 0; } // // Initial ban check against user id, IP and email address --- 57,145 ---- $last_visit = 0; $current_time = time(); ! // ! // Are auto-logins allowed? ! // If allow_autologin is not set or is true then they are ! // (same behaviour as old 2.0.x session code) // ! if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { ! $enable_autologin = $sessiondata['autologinid'] = false; } ! // ! // First off attempt to join with the autologin value if we have one ! // If not, just use the user_id value ! // ! $userdata = array(); ! if ($user_id != ANONYMOUS) { ! if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { ! $sql = 'SELECT u.* ! FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k ! WHERE u.user_id = ' . (int) $user_id . " ! AND u.user_active = 1 ! AND k.user_id = u.user_id ! AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; ! if (!($result = $db->sql_query($sql))) { ! message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } ! $userdata = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! ! $enable_autologin = $login = 1; } ! else if (!$auto_create) { + $sessiondata['autologinid'] = ''; + $sessiondata['userid'] = $user_id; + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id . ' + AND user_active = 1'; + if (!($result = $db->sql_query($sql))) + { + message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); + } + + $userdata = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $login = 1; } } ! ! // ! // At this point either $userdata should be populated or ! // one of the below is true ! // * Key didn't match one in the DB ! // * User does not exist ! // * User is inactive ! // ! if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { ! $sessiondata['autologinid'] = ''; ! $sessiondata['userid'] = $user_id = ANONYMOUS; ! $enable_autologin = $login = 0; ! ! $sql = 'SELECT * ! FROM ' . USERS_TABLE . ' ! WHERE user_id = ' . (int) $user_id; ! if (!($result = $db->sql_query($sql))) ! { ! message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); ! } ! ! $userdata = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); } + // // Initial ban check against user id, IP and email address *************** *** 174,178 **** if ( $user_id != ANONYMOUS ) ! {// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : ( $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; --- 192,196 ---- if ( $user_id != ANONYMOUS ) ! { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; *************** *** 189,193 **** $userdata['user_lastvisit'] = $last_visit; ! $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologinid']; $sessiondata['userid'] = $user_id; } --- 207,245 ---- $userdata['user_lastvisit'] = $last_visit; ! // ! // Regenerate the auto-login key ! // ! if ($enable_autologin) ! { ! list($sec, $usec) = explode(' ', microtime()); ! mt_srand(hexdec(substr($session_id, 0, 8)) + (float) $sec + ((float) $usec * 1000000)); ! $auto_login_key = uniqid(mt_rand(), true); ! ! if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') ! { ! $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " ! SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time ! WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; ! } ! else ! { ! $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) ! VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; ! } ! ! if ( !$db->sql_query($sql) ) ! { ! message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); ! } ! ! $sessiondata['autologinid'] = $auto_login_key; ! unset($auto_login_key); ! } ! else ! { ! $sessiondata['autologinid'] = ''; ! } ! ! // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologinid']; $sessiondata['userid'] = $user_id; } *************** *** 201,204 **** --- 253,257 ---- $userdata['session_time'] = $current_time; $userdata['session_admin'] = $admin; + $userdata['session_key'] = $sessiondata['autologinid']; setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure); *************** *** 311,325 **** } ! // ! // Delete expired sessions ! // ! $expiry_time = $current_time - $board_config['session_length']; ! $sql = "DELETE FROM " . SESSIONS_TABLE . " ! WHERE session_time < $expiry_time ! AND session_id <> '$session_id'"; ! if ( !$db->sql_query($sql) ) ! { ! message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); ! } setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure); --- 364,368 ---- } ! session_clean($userdata['session_id']); setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure); *************** *** 347,358 **** } ! // ! // session_end closes out a session ! // deleting the corresponding entry ! // in the sessions table ! // function session_end($session_id, $user_id) { ! global $db, $lang, $board_config; global $SID; --- 390,401 ---- } ! /** ! * Terminates the specified session ! * It will delete the entry in the sessions table for this session, ! * remove the corresponding auto-login key and reset the cookies ! */ function session_end($session_id, $user_id) { ! global $db, $lang, $board_config, $userdata; global $SID; *************** *** 364,381 **** $current_time = time(); - // - // Pull cookiedata or grab the URI propagated sid - // - if ( isset($_COOKIE[$cookiename . '_sid']) ) - { - $session_id = isset( $_COOKIE[$cookiename . '_sid'] ) ? $_COOKIE[$cookiename . '_sid'] : ''; - $sessionmethod = SESSION_METHOD_COOKIE; - } - else - { - $session_id = ( isset($_GET['sid']) ) ? $_GET['sid'] : ''; - $sessionmethod = SESSION_METHOD_GET; - } - if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { --- 407,410 ---- *************** *** 386,390 **** // Delete existing session // ! $sql = "DELETE FROM " . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; --- 415,419 ---- // Delete existing session // ! $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; *************** *** 394,397 **** --- 423,458 ---- } + // + // Remove this auto-login entry (if applicable) + // + if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) + { + $autologin_key = md5($userdata['session_key']); + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE user_id = ' . (int) $user_id . " + AND key_id = '$autologin_key'"; + if ( !$db->sql_query($sql) ) + { + message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); + } + } + + // + // We expect that message_die will be called after this function, + // but just in case it isn't, reset $userdata to the details for a guest + // + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . ANONYMOUS; + if ( !($result = $db->sql_query($sql)) ) + { + message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); + } + if ( !($userdata = $db->sql_fetchrow($result)) ) + { + message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); + } + $db->sql_freeresult($result); + setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); *************** *** 400,403 **** --- 461,498 ---- } + /** + * Removes expired sessions and auto-login keys from the database + */ + function session_clean($session_id) + { + global $board_config, $db; + + // + // Delete expired sessions + // + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE session_time < ' . (time() - (int) $board_config['session_length']) . " + AND session_id <> '$session_id'"; + if ( !$db->sql_query($sql) ) + { + message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); + } + + // + // Delete expired auto-login keys + // If max_autologin_time is not set then keys will never be deleted + // (same behaviour as old 2.0.x session code) + // + if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) + { + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE last_login < ' . (time() - (86400 * (int) $board_config['max_autologin_time'])); + $db->sql_query($sql); + } + + return true; + } + + // // Append $SID to a url. Borrowed from phplib and modified. This is an *************** *** 412,416 **** if ( !empty($SID) && !preg_match('#sid=#', $url) ) { ! $url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } --- 507,511 ---- if ( !empty($SID) && !preg_match('#sid=#', $url) ) { ! $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } Index: functions_search.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/functions_search.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_search.php 21 Feb 2005 16:09:12 -0000 1.3 --- functions_search.php 31 Oct 2005 03:18:41 -0000 1.4 *************** *** 90,94 **** } ! function split_words(&$entry, $mode = 'post') { // If you experience problems with the new method, uncomment this block. --- 90,94 ---- } ! function split_words($entry, $mode = 'post') { // If you experience problems with the new method, uncomment this block. Index: usercp_activate.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/usercp_activate.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** usercp_activate.php 19 Jul 2005 23:31:25 -0000 1.3 --- usercp_activate.php 31 Oct 2005 03:18:41 -0000 1.4 *************** *** 48,54 **** else if ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != '')) { ! if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $userdata['user_level'] != ADMIN) ! { ! message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } --- 48,61 ---- else if ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != '')) { ! if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $row['user_newpasswd'] == '') ! { ! if (!$userdata['session_logged_in']) ! { ! redirect(append_sid('login.' . $phpEx . '?redirect=profile.' . $phpEx . '&mode=activate&' . POST_USERS_URL . '=' . $row['user_id'] . '&act_key=' . trim($_GET['act_key']))); ! } ! else if ($userdata['user_level'] != ADMIN) ! { ! message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); ! } } Index: page_header.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/page_header.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** page_header.php 8 May 2005 02:12:44 -0000 1.5 --- page_header.php 31 Oct 2005 03:18:41 -0000 1.6 *************** *** 451,454 **** --- 451,462 ---- { $template->assign_block_vars('switch_user_logged_out', array()); + // + // Allow autologin? + // + if (!isset($board_config['allow_autologin']) || $board_config['allow_autologin'] ) + { + $template->assign_block_vars('switch_allow_autologin', array()); + $template->assign_block_vars('switch_user_logged_out.switch_allow_autologin', array()); + } } else Index: bbcode.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/bbcode.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bbcode.php 19 Jul 2005 23:31:24 -0000 1.4 --- bbcode.php 31 Oct 2005 03:18:41 -0000 1.5 *************** *** 197,208 **** // [img]image_url_here[/img] code.. // This one gets first-passed.. ! $patterns[] = "#\[url\]([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is"; $replacements[] = $bbcode_tpl['img']; // matches a [url]xxxx://www.phpbb.com[/url] code.. ! $patterns[] = "#\[url\]((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is"; $replacements[] = $bbcode_tpl['url1']; // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix). $patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; $replacements[] = $bbcode_tpl['url3']; --- 197,212 ---- // [img]image_url_here[/img] code.. // This one gets first-passed.. ! $patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i"; $replacements[] = $bbcode_tpl['img']; // matches a [url]xxxx://www.phpbb.com[/url] code.. ! $patterns[] = "#\[url\]([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is"; $replacements[] = $bbcode_tpl['url1']; // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix). + $patterns[] = "#\[url\]((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is"; + $replacements[] = $bbcode_tpl['url2']; + + // [url=xxxx://www.phpbb.com]phpBB[/url] code.. $patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; $replacements[] = $bbcode_tpl['url3']; *************** *** 210,217 **** // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix). $patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; ! $replacements[] = $bbcode_tpl['url3']; ! ! // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix). ! $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?].*?)\[/url\]#i"; // [email]us...@do...[/email] code.. --- 214,218 ---- // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix). $patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; ! $replacements[] = $bbcode_tpl['url4']; // [email]us...@do...[/email] code.. *************** *** 432,436 **** // Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right. $match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); ! bbcode_array_push($stack, $match); // // Rather than just increment $curr_pos --- 433,437 ---- // Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right. $match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); ! array_push($stack, $match); // // Rather than just increment $curr_pos *************** *** 454,458 **** $curr_nesting_depth = sizeof($stack); // We need to do 2 replacements now. ! $match = bbcode_array_pop($stack); $start_index = $match['pos']; $start_tag = $match['tag']; --- 455,459 ---- $curr_nesting_depth = sizeof($stack); // We need to do 2 replacements now. ! $match = array_pop($stack); $start_index = $match['pos']; $start_tag = $match['tag']; *************** *** 520,524 **** if (sizeof($stack) > 0) { ! $match = bbcode_array_pop($stack); $curr_pos = $match['pos']; // bbcode_array_push($stack, $match); --- 521,525 ---- if (sizeof($stack) > 0) { ! $match = array_pop($stack); $curr_pos = $match['pos']; // bbcode_array_push($stack, $match); *************** *** 624,628 **** // xxxx can only be alpha characters. // yyyy is anything up to the first space, newline, comma, double quote or < ! $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing --- 625,629 ---- // xxxx can only be alpha characters. // yyyy is anything up to the first space, newline, comma, double quote or < ! $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing *************** *** 630,638 **** // zzzz is optional.. will contain everything up to the first space, newline, // comma, double quote or <. ! $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". ! $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); // Remove our padding.. --- 631,639 ---- // zzzz is optional.. will contain everything up to the first space, newline, // comma, double quote or <. ! $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". ! $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); // Remove our padding.. *************** *** 700,703 **** --- 701,705 ---- * however, to keep phpBB compatable with PHP 3 we had to come up with our own * method of doing it. + * This function was deprecated in phpBB 2.0.18 */ function bbcode_array_push(&$stack, $value) *************** *** 711,714 **** --- 713,717 ---- * however, to keep phpBB compatable with PHP 3 we had to come up with our own * method of doing it. + * This function was deprecated in phpBB 2.0.18 */ function bbcode_array_pop(&$stack) *************** *** 761,765 **** for ($i = 0; $i < count($smilies); $i++) { ! $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/"; $repl[] = '<img src="'. $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />'; } --- 764,768 ---- for ($i = 0; $i < count($smilies); $i++) { ! $orig[] = "/(?<=.\W|\W.|^\W)" . preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/"; $repl[] = '<img src="'. $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />'; } Index: constants.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/includes/constants.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** constants.php 20 Nov 2004 01:01:10 -0000 1.2 --- constants.php 31 Oct 2005 03:18:41 -0000 1.3 *************** *** 168,171 **** --- 168,172 ---- define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); define('SESSIONS_TABLE', $table_prefix.'sessions'); + define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys'); define('SMILIES_TABLE', $table_prefix.'smilies'); define('THEMES_TABLE', $table_prefix.'themes'); |