2.0.10 多國語言修正
代碼: 選擇全部
##############################################################
## MOD Title: Multi-Language Fix
## MOD Author: Scorpion <formosa@ms20.url.com.tw> http://ibf.myweb.hinet.net/
## Update to 2.0.10: WeiChou
## Conflation: William Leung <admin@ke5475.net> http://ke5475.net
## MOD Description: Fix the display problems on multi-language
## MOD Version: 2.0.10
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: 7
## login.php
## posting.php
## includes/functions.php
## includes/functions_post.php
## includes/usercp_register.php
## includes/bbcode.php
## admin/admin_users.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
login.php
#
#-----[ FIND ]------------------------------------------
#
$username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : '';
#
#-----[ REPLACE WITH ]----------------------------------
#
$username = isset($HTTP_POST_VARS['username']) ? str_replace("&","&",trim(htmlspecialchars($HTTP_POST_VARS['username']))) : '';
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$poll_options = array();
if ( !empty($HTTP_POST_VARS['poll_option_text']) )
#
#-----[ BEFORE, ADD ]-----------------------------------
#
$subject = ereg_replace("&","&",$subject);
$message = ereg_replace("&","&",$message);
$poll_title = ereg_replace("&","&",$poll_title);
#
#-----[ FIND ]------------------------------------------
#
$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));
#
#-----[ REPLACE WITH ]----------------------------------
#
$poll_options[$option_id] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($option_text))));
#
#-----[ FIND ]------------------------------------------
#
$poll_options[] = htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text'])));
#
#-----[ REPLACE WITH ]----------------------------------
#
$poll_options[] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text']))));
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
$user = trim(htmlspecialchars($user));
#
#-----[ REPLACE WITH ]----------------------------------
#
$user = str_replace("&","&",trim(htmlspecialchars($user)));
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
$subject = htmlspecialchars(trim($subject));
#
#-----[ REPLACE WITH ]----------------------------------
#
$subject = ereg_replace("&","&",htmlspecialchars(trim($subject)));
#
#-----[ FIND ]------------------------------------------
#
$poll_title = htmlspecialchars(trim($poll_title));
#
#-----[ REPLACE WITH ]----------------------------------
#
$poll_title = ereg_replace("&","&",htmlspecialchars(trim($poll_title)));
#
#-----[ FIND ]------------------------------------------
#
$option_text = str_replace("\'", "''", htmlspecialchars($option_text));
#
#-----[ AFTER, ADD ]------------------------------------
#
$option_text = str_replace("&","&", $option_text);
#
#-----[ OPEN ]------------------------------------------
#
includes\usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
#
#-----[ REPLACE WITH ]----------------------------------
#
$$var = str_replace("&","&",trim(htmlspecialchars($HTTP_POST_VARS[$param])));
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#');
$code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}');
#
#-----[ REPLACE WITH ]----------------------------------
#
$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\(#', '#\)#');
$code_entities_replace = array('<', '>', '"', ':', '(', ')');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : '';
#
#-----[ REPLACE WITH ]----------------------------------
#
$username = ( !empty($HTTP_POST_VARS['username']) ) ? ereg_replace("&","&",trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username'])))) : '';
#
#-----[ FIND ]------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));
$occupation = htmlspecialchars(stripslashes($occupation));
$interests = htmlspecialchars(stripslashes($interests));
$signature = htmlspecialchars(stripslashes($signature));
#
#-----[ REPLACE WITH ]----------------------------------
#
$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location)));
$occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation)));
$interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests)));
$signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));
#
#-----[ FIND ]------------------------------------------
#
$username = htmlspecialchars(stripslashes($username));
#
#-----[ REPLACE WITH ]----------------------------------
#
$username = ereg_replace("&","&",htmlspecialchars(stripslashes($username)));
#
#-----[ FIND ]------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));
$occupation = htmlspecialchars(stripslashes($occupation));
$interests = htmlspecialchars(stripslashes($interests));
$signature = htmlspecialchars(stripslashes($signature));
#
#-----[ REPLACE WITH ]----------------------------------
#
$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location)));
$occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation)));
$interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests)));
$signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
# EoM
2.0.11 多國語言修正
代碼: 選擇全部
#
#-----[ OPEN 打開 ]------------------------------------------------
#
posting.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#618 列
$poll_options = array();
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
# 預覽標題、預覽後欄框文章內容及標題、投票議題
#
$subject = ereg_replace("&","&",$subject);
$message = ereg_replace("&","&",$message);
$poll_title = ereg_replace("&","&",$poll_title);
#
#-----[ FIND 尋找 ]------------------------------------------------
#633 列
$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 預覽之後的投票選項 (option)、增加選項之後的舊選項、更新選項
#
$poll_options[$option_id] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($option_text))));
#
#-----[ FIND 尋找 ]------------------------------------------------
#640 列
$poll_options[] = htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text'])));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 新增投票選項之後欄框裡面的選項內容
#
$poll_options[] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text']))));
#
#-----[ OPEN 打開 ]------------------------------------------------
#
includes\functions_post.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#152 列
$subject = htmlspecialchars(trim($subject));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 發表之後的主題標題
#
$subject = ereg_replace("&","&",htmlspecialchars(trim($subject)));
#
#-----[ FIND 尋找 ]------------------------------------------------
#179 列
$poll_title = htmlspecialchars(trim($poll_title));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 發表之後的投票議題
#
$poll_title = ereg_replace("&","&",htmlspecialchars(trim($poll_title)));
#
#-----[ FIND 尋找 ]------------------------------------------------
#331 列
$option_text = str_replace("\'", "''", htmlspecialchars($option_text));
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
# 發表之後的投票選項 (2.0.4 起新產生的問題)
#
\n$option_text = str_replace("&","&", $option_text);
#
#-----[ OPEN 打開 ]------------------------------------------------
#
includes\usercp_register.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#108 列
$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 使用者名稱 (2.0.4 起新產生的問題)
#
$$var = str_replace("&","&",trim(htmlspecialchars($HTTP_POST_VARS[$param])));
#
#-----[ OPEN 打開 ]------------------------------------------------
#
includes\bbcode.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#
$curr_pos = strpos($text, "[", $curr_pos);
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 引言修正
# http://phpbb-tw.net/phpbb/viewtopic.php?p=102297#102297
#
if ( ord(substr($text, $curr_pos, 1)) > 0xa0 )
{
$curr_pos += 2;
continue;
}
else if ( substr($text, $curr_pos, 1) != '[' )
{
$curr_pos++;
continue;
}
#
#-----[ FIND 尋找 ]------------------------------------------------
#483 列
$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#');
$code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}');
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# code標籤內的某些中文字變成 ?#91; ?#93; ?#123; ?#125; 問題
#
$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\(#', '#\)#');
$code_entities_replace = array('<', '>', '"', ':', '(', ')');
#
#-----[ OPEN 打開 ]------------------------------------------------
#
admin\admin_users.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#219 列
$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : '';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#
$username = ( !empty($HTTP_POST_VARS['username']) ) ? ereg_replace("&","&",trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username'])))) : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#285 列
$location = htmlspecialchars(stripslashes($location));
$occupation = htmlspecialchars(stripslashes($occupation));
$interests = htmlspecialchars(stripslashes($interests));
$signature = htmlspecialchars(stripslashes($signature));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#
$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location)));
$occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation)));
$interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests)));
$signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));
#
#-----[ FIND 尋找 ]------------------------------------------------
#708 列
$username = htmlspecialchars(stripslashes($username));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#
$username = ereg_replace("&","&",htmlspecialchars(stripslashes($username)));
#
#-----[ FIND 尋找 ]------------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));
$occupation = htmlspecialchars(stripslashes($occupation));
$interests = htmlspecialchars(stripslashes($interests));
$signature = htmlspecialchars(stripslashes($signature));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#719 列
$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location)));
$occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation)));
$interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests)));
$signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));
#
#-----[ FIND 尋找 ]------------------------------------------------
#741 列
$location = htmlspecialchars($this_userdata['user_from']);
$occupation = htmlspecialchars($this_userdata['user_occ']);
$interests = htmlspecialchars($this_userdata['user_interests']);
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
# 從管理控制台編輯會員資料時,來自、 職業、 興趣三個欄位的多國文字顯示問題
#
$location = ereg_replace("&","&",htmlspecialchars($this_userdata['user_from']));
$occupation = ereg_replace("&","&",htmlspecialchars($this_userdata['user_occ']));
$interests = ereg_replace("&","&",htmlspecialchars($this_userdata['user_interests']));
#
#-----[ OPEN 打開 ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND 尋找 ]------------------------------------------------
# (2.0.11 起新產生的問題)
$username = htmlspecialchars(rtrim(trim($username), "\\\"));
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#
$username = ereg_replace("&","&",htmlspecialchars(trim(trim($username), "\\\")));
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
我發現login.php跟functions.php在2.0.10時要修改, 但2.0.11時卻沒了...難道問題出在這? 還是2.0.11已經自動修正了?