OSDN Git Service

Sample: http://google.ca/
authorhenoheno <henoheno>
Thu, 11 Jan 2007 16:06:54 +0000 (01:06 +0900)
committerhenoheno <henoheno>
Thu, 11 Jan 2007 16:06:54 +0000 (01:06 +0900)
spam.php
spam/spam.php

index 81a7943..ab3a372 100644 (file)
--- a/spam.php
+++ b/spam.php
@@ -1,5 +1,5 @@
 <?php
-// $Id: spam.php,v 1.106 2007/01/11 15:51:12 henoheno Exp $
+// $Id: spam.php,v 1.107 2007/01/11 16:06:54 henoheno Exp $
 // Copyright (C) 2006-2007 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 // Functions for Concept-work of spam-uri metrics
@@ -347,7 +347,7 @@ function spam_uri_pickup_preprocess($string = '')
        $string = preg_replace_callback(
                array(
                        // Something Google: http://www.google.com/supported_domains
-                       '#(http)://([a-z0-9.]+\.google\.[a-z]{2,3}(?:\.[a-z]{2})?)/' .
+                       '#(http)://((?:[a-z0-9.]+\.)?google\.[a-z]{2,3}(?:\.[a-z]{2})?)/' .
                        '([ a-z0-9?=&.%_+-]+)' .                                        // ?query=foo+bar hoge
                        '\bsite:([a-z0-9.%_-]+\.[a-z0-9.%_-]+)' .       // site:nasty.example.com
                        //'()' .        // Preserve or remove?
index 81a7943..ab3a372 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-// $Id: spam.php,v 1.106 2007/01/11 15:51:12 henoheno Exp $
+// $Id: spam.php,v 1.107 2007/01/11 16:06:54 henoheno Exp $
 // Copyright (C) 2006-2007 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 // Functions for Concept-work of spam-uri metrics
@@ -347,7 +347,7 @@ function spam_uri_pickup_preprocess($string = '')
        $string = preg_replace_callback(
                array(
                        // Something Google: http://www.google.com/supported_domains
-                       '#(http)://([a-z0-9.]+\.google\.[a-z]{2,3}(?:\.[a-z]{2})?)/' .
+                       '#(http)://((?:[a-z0-9.]+\.)?google\.[a-z]{2,3}(?:\.[a-z]{2})?)/' .
                        '([ a-z0-9?=&.%_+-]+)' .                                        // ?query=foo+bar hoge
                        '\bsite:([a-z0-9.%_-]+\.[a-z0-9.%_-]+)' .       // site:nasty.example.com
                        //'()' .        // Preserve or remove?