2003.10.23 (木) 23:53:48 <u*j*2*6*> IM/チャット発言・トピック・emoteでrtfコードが使えないようにしました。設定→Other3→「rtfコードつきのメッセージを許可する」にチェックすると使えます(危険)。
2003.10.23 (木) 23:54:55 <u*j*2*6*> また、IDにrtfコードとピリオド、コード#127の制御文字をつかえないようにしました。
2003.10.23 (木) 23:55:45 <u*j*2*6*> それから、検索文字列での制御文字もブロックするようにしました。ログ画面が黒くなるのをふせぐそうです(211125参照)
shuusei241100:IM・チャットでのrtfコードつきメッセージと検索文字列での制御文字のブロック(211103,211125参照,source by Heracules)

diff --dos -ur 24199/channels.pas 241100/channels.pas
--- 24199/channels.pas	Fri Mar 21 05:12:44 2003
+++ 241100/channels.pas	Thu Oct 23 23:18:38 2003
@@ -219,6 +219,7 @@
 begin
  if str='' then exit;
  if topic=str then exit;
+ if not allow_rtf_code and (Pos('{\rtf', str) > 0) then Exit;
  topic:=str;
  for i:=0 to users.count-1 do
  begin
diff --dos -ur 24199/constants.pas 241100/constants.pas
--- 24199/constants.pas	Thu Oct 23 17:16:18 2003
+++ 241100/constants.pas	Thu Oct 23 18:53:22 2003
@@ -27,7 +27,7 @@
  SLAVANAP_VERSION             = '2.4.1';
  SLAVANAP_BUILD               = '108';
  SLAVANAP_BUILD_DATE          = '24 January 2003';
- SLAVANAP_SHUUSEI             = '99';
+ SLAVANAP_SHUUSEI             = '100';
  SLAVANAP_SHUUSEI_DATE        = '23 October 2003';
  SLAVANAP_VERSION_SHORT       = SLAVANAP_TITLE+' '+SLAVANAP_VERSION;
  SLAVANAP_FULL                = SLAVANAP_TITLE+' '+SLAVANAP_VERSION+
diff --dos -ur 24199/english.lng 241100/english.lng
--- 24199/english.lng	Wed Oct 22 02:04:34 2003
+++ 241100/english.lng	Thu Oct 23 22:55:04 2003
@@ -7,7 +7,7 @@
 Version=2.4.1
 Comments=Original file by SlavaNap development team
 BUILD=108
-SHUUSEI=98
+SHUUSEI=100
 
 [Log]
 SERVER_INIT=Starting $1
@@ -986,6 +986,7 @@
 S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS       =Block User's 827(List All) command
 S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE         =Block XNap's weird filename
 S_SHOTHER3_CB_SUGGEST_DBROWSE              =Send IM to recommend direct-browse
+S_SHOTHER3_CB_ALLOW_RTF_CODE               =Allow messages in rtf-code
 S_SHOTHER4_LABEL164                        =List of Japanese Clients (check to block)
 S_SHOTHER4_CB_BLOCK_NAPCHAN                =Napchan
 S_SHOTHER4_CB_BLOCK_UTATANE                =Utatane
diff --dos -ur 24199/handler.pas 241100/handler.pas
--- 24199/handler.pas	Thu Oct 23 17:18:24 2003
+++ 241100/handler.pas	Thu Oct 23 23:39:18 2003
@@ -2154,6 +2154,7 @@
  tmp_pos:=272;
  msg:=Copy(NextParamEx(gcmd.cmd),1,max_privmsg_len);
  if trim(msg)='' then exit;
+ if not allow_rtf_code and (Pos('{\rtf', msg) > 0) then Exit;
  if (msg='//WantQueue') then
  begin
    tmp_pos:=122621;
@@ -3386,12 +3387,18 @@
      if hlist.Count<3 then err:=true
      else
      begin
-       dec:=3;
-       if uppercase(hlist.Strings[1])='CONTAINS' then
-         search_data.include:=search_data.include+AnsiLowerCase(hlist.Strings[2])+' '
-       else if uppercase(hlist.Strings[1])='EXCLUDES' then
-         search_data.exclude:=search_data.exclude+AnsiLowerCase(hlist.Strings[2])+' '
-       else err:=true;
+       for i := 1 to Length(hlist.Strings[2]) do
+         if hlist.Strings[2][i] in [Chr(0)..Chr(31), Chr(127)] then
+           err := true;
+       if not err then
+       begin
+         dec:=3;
+         if uppercase(hlist.Strings[1])='CONTAINS' then
+           search_data.include:=search_data.include+AnsiLowerCase(hlist.Strings[2])+' '
+         else if uppercase(hlist.Strings[1])='EXCLUDES' then
+           search_data.exclude:=search_data.exclude+AnsiLowerCase(hlist.Strings[2])+' '
+         else err:=true;
+       end;
      end;
    end; // end FILENAME
    if hlist.Strings[0]='MAX_RESULTS' then
@@ -5305,6 +5312,7 @@
  if ch=nil then exit;
  if ch.FindUser(user)=-1 then exit;
  str:=NextParamEx(gcmd.cmd);
+ if not allow_rtf_code and (Pos('{\rtf', str) > 0) then Exit;
  tmp_pos:=492;
  if trim(str)='' then exit;
  if prevent_shouting and (user^.level<napUserModerator) then
@@ -5393,6 +5401,7 @@
  // if AnsiUpperCase(str)=AnsiLowerCase(str) then exit;
  tmp_pos:=502;
  if block_cqex_chat then BlockCQEXChat(str);
+ if not allow_rtf_code and (Pos('{\rtf', str) > 0) then Exit;
  if Length(str)>max_channelmsg_len then
   str:=Copy(str,1,max_channelmsg_len);
  if prevent_shouting and (user^.level<napUserModerator) then
diff --dos -ur 24199/japanese.lng 241100/japanese.lng
--- 24199/japanese.lng	Wed Oct 22 02:04:32 2003
+++ 241100/japanese.lng	Thu Oct 23 22:55:02 2003
@@ -7,7 +7,7 @@
 Version=2.4.1.108
 Comments=Translated by usj12262@hotmail.com
 BUILD=108
-SHUUSEI=98
+SHUUSEI=100
 
 [Log]
 SERVER_INIT=$1を起動中…
@@ -986,6 +986,7 @@
 S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS      =一般ユーザーの827番コマンドを拒否
 S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE        =XNapの文字化け共有をブロック
 S_SHOTHER3_CB_SUGGEST_DBROWSE             =直接参照を促すメッセージを送る
+S_SHOTHER3_CB_ALLOW_RTF_CODE              =rtfコードつきのメッセージを許可する
 S_SHOTHER4_LABEL164                       =和製クライアントのブロック (チェックするとブロックします)
 S_SHOTHER4_CB_BLOCK_NAPCHAN               =Napchan
 S_SHOTHER4_CB_BLOCK_UTATANE               =Utatane
diff --dos -ur 24199/lang.pas 241100/lang.pas
--- 24199/lang.pas	Wed Oct 22 02:07:50 2003
+++ 241100/lang.pas	Thu Oct 23 22:50:04 2003
@@ -1184,6 +1184,7 @@
  LNG_S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS      = 1813;
  LNG_S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE        = 1814;
  LNG_S_SHOTHER3_CB_SUGGEST_DBROWSE             = 1815;
+ LNG_S_SHOTHER3_CB_ALLOW_RTF_CODE              = 1816;
  LNG_S_SHOTHER4_LABEL164                       = 1821;
  LNG_S_SHOTHER4_CB_BLOCK_NAPCHAN               = 1822;
  LNG_S_SHOTHER4_CB_BLOCK_UTATANE               = 1823;
@@ -2566,6 +2567,7 @@
   GetIni(ini,LNG_S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS       ,'Settings','S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS');
   GetIni(ini,LNG_S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE         ,'Settings','S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE');
   GetIni(ini,LNG_S_SHOTHER3_CB_SUGGEST_DBROWSE              ,'Settings','S_SHOTHER3_CB_SUGGEST_DBROWSE');
+  GetIni(ini,LNG_S_SHOTHER3_CB_ALLOW_RTF_CODE               ,'Settings','S_SHOTHER3_CB_ALLOW_RTF_CODE');
   GetIni(ini,LNG_S_SHOTHER4_LABEL164                        ,'Settings','S_SHOTHER4_LABEL164');
   GetIni(ini,LNG_S_SHOTHER4_CB_BLOCK_NAPCHAN                ,'Settings','S_SHOTHER4_CB_BLOCK_NAPCHAN');
   GetIni(ini,LNG_S_SHOTHER4_CB_BLOCK_UTATANE                ,'Settings','S_SHOTHER4_CB_BLOCK_UTATANE');
diff --dos -ur 24199/mainform.pas 241100/mainform.pas
--- 24199/mainform.pas	Thu Oct 23 17:16:44 2003
+++ 241100/mainform.pas	Thu Oct 23 22:50:38 2003
@@ -1517,6 +1517,7 @@
   suggest_dbrowse:=ini.ReadBool('Other2','SuggestDirectBrowse',false);
   log_folder:=ini.ReadString('Other2','LogFolder',ApplicationDir);
   max_resolving_count:=ini.ReadInteger('Other2','MaxResolvingCount',3);
+  allow_rtf_code:=ini.ReadBool('Other2','AllowRTFCode',false);
   // set up console
   LogStartup('mainform::loadconfig: setting up console user');
   cons_channels:=TMyList.Create;
@@ -1995,6 +1996,7 @@
   ini.WriteBool('Other2','SuggestDirectBrowse',suggest_dbrowse);
   ini.WriteString('Other2','LogFolder',log_folder);
   ini.WriteInteger('Other2','MaxResolvingCount',max_resolving_count);
+  ini.WriteBool('Other2','AllowRTFCode',allow_rtf_code);
   finally
   ini.Free;
  end;
diff --dos -ur 24199/settings.dfm 241100/settings.dfm
--- 24199/settings.dfm	Wed Oct 22 06:52:58 2003
+++ 241100/settings.dfm	Thu Oct 23 23:38:00 2003
@@ -285,7 +285,7 @@
       Top = 38
       Width = 365
       Height = 392
-      ActivePage = sh_other4
+      ActivePage = sh_other3
       Align = alClient
       MultiLine = True
       OwnerDraw = True
@@ -1865,7 +1865,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 9
         end
       end
@@ -2362,7 +2362,7 @@
           Width = 111
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 1
         end
         object Edit_cons_autojoin1: TEdit
@@ -5391,7 +5391,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 9
         end
       end
@@ -5735,7 +5735,7 @@
             Width = 73
             Height = 20
             Style = csDropDownList
-            ItemHeight = 0
+            ItemHeight = 12
             TabOrder = 4
             Visible = False
           end
@@ -5790,7 +5790,7 @@
             Width = 73
             Height = 20
             Style = csDropDownList
-            ItemHeight = 0
+            ItemHeight = 12
             TabOrder = 4
             Visible = False
           end
@@ -6091,6 +6091,14 @@
           Height = 17
           Caption = '直接参照を促すメッセージを送る'
           TabOrder = 15
+        end
+        object cb_allow_rtf_code: TCheckBox
+          Left = 8
+          Top = 256
+          Width = 201
+          Height = 17
+          Caption = 'rtfコードつきのメッセージを許可する'
+          TabOrder = 16
         end
       end
       object sh_other4: TTabSheet
diff --dos -ur 24199/settings.pas 241100/settings.pas
--- 24199/settings.pas	Wed Oct 22 02:07:12 2003
+++ 241100/settings.pas	Thu Oct 23 22:52:16 2003
@@ -621,6 +621,7 @@
     cb_refresh_users: TCheckBox;
     edit_usersreftime: TSpinEdit;
     Label166: TLabel;
+    cb_allow_rtf_code: TCheckBox;
     procedure Panel3Resize(Sender: TObject);
     procedure headerPaint(Sender: TObject);
     procedure SetTopText(str: String);
@@ -1599,6 +1600,7 @@
  cb_deny_listall_for_users.Checked:=not listall_for_users;
  cb_block_weird_xnapfile.Checked:=block_weird_xnapfile;
  cb_suggest_dbrowse.Checked:=suggest_dbrowse;
+ cb_allow_rtf_code.Checked:=allow_rtf_code;
 end;
 
 procedure TSlavaNapSettings.sh_other4Show(Sender: TObject);
@@ -2212,6 +2214,7 @@
    listall_for_users:=not cb_deny_listall_for_users.Checked;
    block_weird_xnapfile:=cb_block_weird_xnapfile.Checked;
    suggest_dbrowse:=cb_suggest_dbrowse.Checked;
+   allow_rtf_code:=cb_allow_rtf_code.Checked;
   except
  end else if pages.ActivePage=sh_other4 then
  try
@@ -3109,6 +3112,7 @@
   cb_deny_listall_for_users.Caption    :=GetLangI(LNG_S_SHOTHER3_CB_DENY_LISTALL_FOR_USERS);
   cb_block_weird_xnapfile.Caption      :=GetLangI(LNG_S_SHOTHER3_CB_BLOCK_WEIRD_XNAPFILE);
   cb_suggest_dbrowse.Caption           :=GetLangI(LNG_S_SHOTHER3_CB_SUGGEST_DBROWSE);
+  cb_allow_rtf_code.Caption            :=GetLangI(LNG_S_SHOTHER3_CB_ALLOW_RTF_CODE);
   //sh_other4
   Label164.Caption                     :=GetLangI(LNG_S_SHOTHER4_LABEL164);
   cb_block_napchan.Caption             :=GetLangI(LNG_S_SHOTHER4_CB_BLOCK_NAPCHAN);
diff --dos -ur 24199/stypes.pas 241100/stypes.pas
--- 24199/stypes.pas	Tue Oct 21 19:43:54 2003
+++ 241100/stypes.pas	Thu Oct 23 23:34:00 2003
@@ -1222,8 +1222,9 @@
  if allow_2bytename then
  begin
    if AnsiPos(' ', str) > 0 then Exit;
+   if Pos('{\rtf', str) > 0 then Exit;
    for i:=1 to Length(str) do
-     if str[i]<='!' then exit;
+     if (str[i]<='!') or (str[i]='.') or (str[i]=#127) then exit;
  end
  else
    for i:=1 to Length(str) do
diff --dos -ur 24199/vars.pas 241100/vars.pas
--- 24199/vars.pas	Thu Oct 23 17:16:20 2003
+++ 241100/vars.pas	Thu Oct 23 22:49:48 2003
@@ -345,6 +345,7 @@
  max_resolving_count: Integer;
  db_login: TMyList;
  last_force_enter: Cardinal;
+ allow_rtf_code: Boolean;
 implementation
 
 procedure CheckWindows;