转贴关于 LBS 2.0.300 两个 Bug 的非官方修正

[ 2005-06-08 19:18:31 | 作者: Ronnier ]
字体大小: | |
6.9 更新,果然这两问题看来 SiC 也很重视啊,今天发布了 LBS 2.0.301 版,升级吧升级吧,升了就 OK 了,呵呵 [lol]

今天在 SiC 的留言簿上看到的,仔细看了一下,个人认为这两个应该算是比较严重的问题,故虽然是非官方的修正办法,仍建议所有 LBS2 用户进行修正。

1. 自动转换链接功能的一个 Bug 修正
class/ubbcode.asp 文件,toHTML() 函数里面
找到
 var re=/([^\=\]][\s]*?|^)(http|https|rstp|ftp|mms|ed2k):\/\/(.*?)(\>|\<|\&quot\;|\&gt\;|\&lt\;|\)|\(|$| )/igm;
替换成
 var re=/([^\=\]][\s]*?|^)(http|https|rstp|ftp|mms|ed2k):\/\/(.*?)(\[|\>|\<|\&quot\;|\&gt\;|\&lt\;|\)|\(|$| )/igm;

2. 发帖时间变成 5.31 的 Bug 修正
class/function.asp 文件,parseDateTime() 函数里面
找到
 strDate=strDate.split("-");
 if(strDate.length!=3){
 return null;
 }else{
 iNum=parseInt(strDate[0]);
 if(iNum!=NaN) theDate.setFullYear(iNum);
 iNum=parseInt(strDate[1]));
 if(iNum!=NaN) theDate.setMonth(iNum-1);
 iNum=parseInt(strDate[2]);
 if(iNum!=NaN) theDate.setDate(iNum);
 }
 
 strTime=strTime.split(":");
 if(strTime.length==3){
 iNum=parseInt(strTime[0]);
 if(iNum!=NaN) theDate.setHours(iNum);
 iNum=parseInt(strTime[1]);
 if(iNum!=NaN) theDate.setMinutes(iNum);
 iNum=parseInt(strTime[2]);
 if(iNum!=NaN) theDate.setSeconds(iNum);
 }
替换成
 strDate=strDate.split("-");
 if(strDate.length!=3){
 return null;
 }else{
 iNum=parseInt(strDate[0]);
 if(iNum!=NaN) theDate.setFullYear(iNum);
 iNum=parseInt(strDate[1].replace(/\b0/,""));
 if(iNum!=NaN) theDate.setMonth(iNum-1);
 iNum=parseInt(strDate[2].replace(/\b0/,""));
 if(iNum!=NaN) theDate.setDate(iNum);
 }

 strTime=strTime.split(":");
 if(strTime.length==3){
 iNum=parseInt(strTime[0].replace(/\b0/,""));
 if(iNum!=NaN) theDate.setHours(iNum);
 iNum=parseInt(strTime[1].replace(/\b0/,""));
 if(iNum!=NaN) theDate.setMinutes(iNum);
 iNum=parseInt(strTime[2].replace(/\b0/,""));
 if(iNum!=NaN) theDate.setSeconds(iNum);
 }
[最后由 Ronnier 修改于 2005-06-09 17:11:42]
评论 Feed 评论 Feed: http://www.ronnier.me/feed.asp?q=comment&id=34

这篇日志没有评论.

发表
表情图标
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
启用 UBB 代码
自动转换链接
使用表情图标
悄悄话
用户名:   密码:   注册?
验证码 * 请输入验证码