[Bast-commits] r9943 - ironman/Perlanet-IronMan/trunk/lib/Perlanet

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Sat Sep 22 10:59:05 GMT 2012


Author: idn
Date: 2012-09-22 10:59:05 +0000 (Sat, 22 Sep 2012)
New Revision: 9943

Modified:
   ironman/Perlanet-IronMan/trunk/lib/Perlanet/IronMan.pm
Log:
Layout changes.  Adding word boundary matches to the regular expressions.  Always assume that the word will be surrounded by a word boundary character

Modified: ironman/Perlanet-IronMan/trunk/lib/Perlanet/IronMan.pm
===================================================================
--- ironman/Perlanet-IronMan/trunk/lib/Perlanet/IronMan.pm	2012-07-22 22:48:02 UTC (rev 9942)
+++ ironman/Perlanet-IronMan/trunk/lib/Perlanet/IronMan.pm	2012-09-22 10:59:05 UTC (rev 9943)
@@ -63,34 +63,34 @@
     
   # Definitions for HTML::Scrub
   my %scrub_def = (
-      '*'    => 1,                        # default rule, allow all attributes
-      'href' => qr{^(?!(?:java)?script)}i,
-      'src'  => qr{^(?!(?:java)?script)}i,
-      'cite'     => '(?i-xsm:^(?!(?:java)?script))',
-      'language' => 0,
+      '*'           => 1,                        # default rule, allow all attributes
+      'href'        => qr{^(?!(?:java)?script)}i,
+      'src'         => qr{^(?!(?:java)?script)}i,
+      'cite'        => '(?i-xsm:^(?!(?:java)?script))',
+      'language'    => 0,
       'name'        => 1,                 # could be sneaky, but hey ;)
       'onblur'      => 0,
       'onchange'    => 0,
-        'onclick'     => 0,
-        'ondblclick'  => 0,
-        'onerror'     => 0,
-        'onfocus'     => 0,
-        'onkeydown'   => 0,
-        'onkeypress'  => 0,
-        'onkeyup'     => 0,
-        'onload'      => 0,
-        'onmousedown' => 0,
-        'onmousemove' => 0,
-        'onmouseout'  => 0,
-        'onmouseover' => 0,
-        'onmouseup'   => 0,
-        'onreset'     => 0,
-        'onselect'    => 0,
-        'onsubmit'    => 0,
-        'onunload'    => 0,
-        'src'         => 0,
-        'type'        => 0,
-        'style'       => 0,
+      'onclick'     => 0,
+      'ondblclick'  => 0,
+      'onerror'     => 0,
+      'onfocus'     => 0,
+      'onkeydown'   => 0,
+      'onkeypress'  => 0,
+      'onkeyup'     => 0,
+      'onload'      => 0,
+      'onmousedown' => 0,
+      'onmousemove' => 0,
+      'onmouseout'  => 0,
+      'onmouseover' => 0,
+      'onmouseup'   => 0,
+      'onreset'     => 0,
+      'onselect'    => 0,
+      'onsubmit'    => 0,
+      'onunload'    => 0,
+      'src'         => 0,
+      'type'        => 0,
+      'style'       => 0,
   );
 
   my $scrub = HTML::Scrubber->new;
@@ -353,21 +353,21 @@
 
         # If tags have been defined, check them.
         if(defined($xml_entry->tags)) {
-            if(grep(/$filter/i, $xml_entry->tags)) {
+            if(grep(/\b$filter\b/i, $xml_entry->tags)) {
                 return 1;
             }
         }
 
         # Check the title if defined
         if(defined($xml_entry->title)) {
-            if(grep(/$filter/i, $xml_entry->title)) {
+            if(grep(/\b$filter\b/i, $xml_entry->title)) {
                 return 1;
             }
         }
 
         # Check the body if defined
         if(defined($xml_entry->content->body)) {
-            if($xml_entry->content->body =~ m/$filter/i) {
+            if($xml_entry->content->body =~ m/\b$filter\b/i) {
                 return 1;
             }
         }




More information about the Bast-commits mailing list