From 57af9e2df8f466a9f2cfbb7b3f6efb4f381ee255 Mon Sep 17 00:00:00 2001 From: yamat0jp Date: Sat, 11 Jan 2020 08:16:45 +0900 Subject: [PATCH] =?utf8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E8=A1=A8=E7=A4=BA?= =?utf8?q?=E3=82=92=E8=A8=82=E6=AD=A3=20=E8=A8=AD=E5=AE=9A=E3=83=AC?= =?utf8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AB=E3=83=95=E3=82=A3=E3=83=BC?= =?utf8?q?=E3=83=AB=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Unit1.dfm | 4 ++++ Unit1.pas | 1 + WebModuleUnit1.pas | 48 ++++++++++++++++++++++++++++++++---------------- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Unit1.dfm b/Unit1.dfm index 9fa646d..061c926 100644 --- a/Unit1.dfm +++ b/Unit1.dfm @@ -118,6 +118,10 @@ object DataModule1: TDataModule1 FieldName = 'password' Size = 100 end + object FDTable3ng: TWideStringField + FieldName = 'ng' + Size = 300 + end end object FDGUIxWaitCursor1: TFDGUIxWaitCursor Provider = 'Forms' diff --git a/Unit1.pas b/Unit1.pas index e0aa29c..1e2df4f 100644 --- a/Unit1.pas +++ b/Unit1.pas @@ -47,6 +47,7 @@ type FDTable1DATABASE: TWideStringField; FDQuery1: TFDQuery; FDTable3password: TWideStringField; + FDTable3ng: TWideStringField; private { Private éŒ¾ } public diff --git a/WebModuleUnit1.pas b/WebModuleUnit1.pas index fb49fbd..4ebcafe 100644 --- a/WebModuleUnit1.pas +++ b/WebModuleUnit1.pas @@ -108,6 +108,7 @@ type ss: TStringList; tagstr: string; procedure pages(count: Integer; var page: Integer); + procedure strsCheck(var error: string; var list: TStringList); function isInfo: Boolean; function loginCheck: Boolean; function hash(str: string): string; @@ -548,6 +549,29 @@ begin ReplaceText := css2.Content; end; +procedure TWebModule1.strsCheck(var error: string; var list: TStringList); +var + s: TStringList; + i, j: Integer; + x: Boolean; +begin + s := TStringList.Create; + try + s.DelimitedText := DataModule1.FDTable3.FieldByName('ng').AsString; + for i := 0 to s.count - 1 do + for j := 0 to list.count - 1 do + begin + if Pos(s[i], list[j]) > 0 then + x := true; + list[j] := '

' + list[j]; + end; + finally + s.Free; + end; + if x = true then + error := error + '

‹ÖŽ~Œê‹å‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·.'; +end; + procedure TWebModule1.tiHTMLTag(Sender: TObject; Tag: TTag; const TagString: string; TagParams: TStrings; var ReplaceText: string); begin @@ -1015,7 +1039,6 @@ var title, na, raw, pass, kotoba, error: string; s: string; comment: TStringList; - x: Boolean; function scan(Text: string): string; var reg: TRegEx; @@ -1080,25 +1103,16 @@ begin comment := TStringList.Create; try comment.Text := raw; - for i := 0 to comment.count - 1 do - begin - if Pos('ng', comment[i]) > 0 then - begin - error := error + '

‹ÖŽ~Œê‹å‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·.'; - break; - end; - comment[i] := '

' + scan(comment[i]); - end; - x := Request.ContentFields.Values['show'] = 'true'; + strsCheck(error, comment); + Request.ContentFields.Values['show'] := 'false'; + Request.ContentFields.Values['raw'] := raw; if error <> '' then - error := error + '' - else if x = true then + Request.ContentFields.Values['preview'] := error + '' + else if Request.ContentFields.Values['show'] = 'true' then begin error := '

««ƒvƒŒƒrƒ…[««

' + comment.Text; - Request.ContentFields.Values['show'] := 'false'; Request.ContentFields.Values['preview'] := error; - Request.ContentFields.Values['raw'] := raw; end else begin @@ -1152,6 +1166,7 @@ procedure TWebModule1.WebModuleCreate(Sender: TObject); var i: Integer; a: Variant; + s: string; begin with DataModule1 do begin @@ -1183,10 +1198,11 @@ begin if DataModule1.FDTable3.Bof and DataModule1.FDTable3.Eof then begin a := DataModule1.FDTable1.Lookup('database', 'info', 'dbnum'); + s := 'ˆ¢•Û,”nŽ­,Ž€‚Ë'; DataModule1.FDTable3.AppendRecord (['‚Æ‚é‚ˁ`‚Ǎ†', '

‚Æ‚é‚ˁ`‚Ǎ†

', - false, a, 30, hash(hash('admin'))]); + false, a, 30, hash(hash('admin')), s]); end; end; -- 2.11.0