<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>2008/07/13 on Yano&#39;s digital garage</title>
    <link>https://www.bravotouring.com/~yano/archives/2008/07/13/</link>
    <description>Recent content in 2008/07/13 on Yano&#39;s digital garage</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 13 Jul 2008 20:21:52 +0900</lastBuildDate>
    <atom:link href="https://www.bravotouring.com/~yano/archives/2008/07/13/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>コメントスパム対策</title>
      <link>https://www.bravotouring.com/~yano/diary/it/20080713antispam.htm</link>
      <pubDate>Sun, 13 Jul 2008 20:21:52 +0900</pubDate>
      <guid>https://www.bravotouring.com/~yano/diary/it/20080713antispam.htm</guid>
      <description>&lt;p&gt;先月実施したコメントスパム対策に問題発覚。&lt;/p&gt;&#xA;&lt;p&gt;&lt;blockquote class=&#34;Log&#34;&gt;&#xA;&lt;span class=&#34;Comment&#34;&gt;// コメントスパム対策の文字列チェック by YANO&lt;/span&gt;&lt;br/&gt;&#xA;define(ANSICHAR_STR,&#34;/^[ -~]+$/&#34;);&lt;br/&gt;&#xA;function IsSpamMessage($string){&lt;br/&gt;&#xA;&lt;br/&gt;&lt;span class=&#34;Comment&#34;&gt;    // TABや改行を削除&lt;/span&gt;&lt;br/&gt;&#xA;    $string = mbereg_replace(&#34;[&lt;span class=&#34;Strong&#34;&gt;\\&lt;/span&gt;s]+&#34;, &#34;&#34;, $string);&lt;br/&gt;&#xA;&lt;br/&gt;&lt;span class=&#34;Comment&#34;&gt;    // 全て半角ANSI文字なら1&lt;/span&gt;&lt;br/&gt;&#xA;    if (preg_match(ANSICHAR_STR, $string)) {&lt;br/&gt;&#xA;        return 1;&lt;br/&gt;&#xA;    }&lt;br/&gt;&#xA;    else{&lt;br/&gt;&#xA;        return 0;&lt;br/&gt;&#xA;    }&lt;br/&gt;&#xA;}&lt;/blockquote&gt;において、全体の文字種チェックを一発で行う為に改行やTABを削除していた&lt;span class=&#34;Software&#34;&gt;mbereg_replace&lt;/span&gt;関数で、pattern文字列の&lt;span class=&#34;Strong&#34;&gt;\&lt;/span&gt;が重なってなかったのでTABが入っていたらチェックをパスしていた。&lt;/p&gt;&#xA;&lt;p&gt;というバグでした。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
