[Bbs2ch-cvs 391] [373] [04_BRANCH] 正規表現をできるだけ行わないようにした

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 2月 16日 (土) 18:22:57 JST


Revision: 373
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=373
Author:   flyson
Date:     2008-02-16 18:22:56 +0900 (Sat, 16 Feb 2008)

Log Message:
-----------
[04_BRANCH] 正規表現をできるだけ行わないようにした

Modified Paths:
--------------
    branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/server/thread.js


-------------- next part --------------
Modified: branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/server/thread.js
===================================================================
--- branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/server/thread.js	2008-02-16 09:17:31 UTC (rev 372)
+++ branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/server/thread.js	2008-02-16 09:22:56 UTC (rev 373)
@@ -315,21 +315,23 @@
 		}
 
 			// resDate ‚ð DATEABeID ‚É•ªŠ„
-		if(resDate.match(/(.+)BE:([^ ]+)/)){
+		if(resDate.indexOf("BE:")!=-1 && resDate.match(/(.+)BE:([^ ]+)/)){
 			resDate = RegExp.$1;
 			resBeID = RegExp.$2;
 		}
 			// resDate ‚ð DATE ‚Æ ID ‚É•ªŠ„
-		if(resDate.match(/(.+)ID:(.+)/)){
+		if(resDate.indexOf("ID:")!=-1 && resDate.match(/(.+)ID:(.+)/)){
 			resDate = RegExp.$1;
 			resID = RegExp.$2;
 		}
 
+		/*
 			// resDate ‚É IP ‚ªŠÜ‚Ü‚ê‚Ä‚¢‚éê‡‚Í IP ‚ð ID ‚Æ‚µ‚Ĉµ‚¤
 		if(resDate.match(/(.+)”­MŒ³:(.+)/)){
 			resDate = RegExp.$1;
 			resID = RegExp.$2;
 		}
+		*/
 
 		if(resBeID){
 			var regBeID = /^(\d+)/;
@@ -373,8 +375,10 @@
 		}
 
 			// ’ʏ탊ƒ“ƒNˆ—
-		var regUrlLink = /(h?ttp)(s)?\:([\-_\.\!\~\*\'\(\)a-zA-Z0-9\;\/\?\:\@\&\=\+\$\,\%\#]+)/g;
-		resMes = resMes.replace(regUrlLink, '<a href="http$2:$3" class="outLink">$1$2:$3</a>');
+		if(resMes.indexOf("ttp")!=-1){
+			var regUrlLink = /(h?ttp)(s)?\:([\-_\.\!\~\*\'\(\)a-zA-Z0-9\;\/\?\:\@\&\=\+\$\,\%\#]+)/g;
+			resMes = resMes.replace(regUrlLink, '<a href="http$2:$3" class="outLink">$1$2:$3</a>');
+		}
 
 			// ƒŒƒXID
 		var regResID = / (ID:)([0-9a-z\+\/]+)/ig;
@@ -671,17 +675,12 @@
 			}
 		}
 
+			// ’ʏ탊ƒ“ƒNˆ—
+		if(resMes.indexOf("ttp")!=-1){
+			var regUrlLink = /(h?ttp)(s)?\:([\-_\.\!\~\*\'\(\)a-zA-Z0-9\;\/\?\:\@\&\=\+\$\,\%\#]+)/g;
+			resMes = resMes.replace(regUrlLink, '<a href="http$2:$3" class="outLink">$1$2:$3</a>');
+		}
 
-
-
-
-
-
-
-			// ’ʏ탊ƒ“ƒNˆ— 
-		var regUrlLink = /(h?ttp)(s)?\:([\-_\.\!\~\*\'\(\)a-zA-Z0-9\;\/\?\:\@\&\=\+\$\,\%\#]+)/g;
-		resMes = resMes.replace(regUrlLink, '<a href="http$2:$3" class="outLink">$1$2:$3</a>');
-
 			// ƒXƒŒƒbƒh‚̃^ƒCƒgƒ‹‚ªŒ©‚‚©‚Á‚½‚Æ‚«‚Í HTML ƒwƒbƒ_‚ð’ljÁ‚µ‚Ä‘—‚é
 		if(!this._headerResponded && resArray[5]!= ""){
 			this._headerResponded = true;


bbs2ch-cvs メーリングリストの案内
Back to archive index