[geeklog-cvs] geeklog-1.3/plugins/spamx BlackList.Examine.class.php,1.5,1.6 IPofUrl.Examine.class.php,1.1,1.2 MTBlackList.Examine.class.php,1.5,1.6

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sun Feb 20 04:51:29 EST 2005


Update of /var/cvs/geeklog-1.3/plugins/spamx
In directory www:/tmp/cvs-serv19163

Modified Files:
	BlackList.Examine.class.php IPofUrl.Examine.class.php 
	MTBlackList.Examine.class.php 
Log Message:
Run post through html_entity_decode() before checking it for spam in case the sapmmers try to obfuscate their posts by using HTML entities.


Index: IPofUrl.Examine.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/IPofUrl.Examine.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IPofUrl.Examine.class.php	26 Jan 2005 10:27:47 -0000	1.1
--- IPofUrl.Examine.class.php	20 Feb 2005 09:51:27 -0000	1.2
***************
*** 16,19 ****
--- 16,28 ----
  
  /**
+ * html_entity_decode is only available as of PHP 4.3.0
+ */
+ if (!function_exists ('html_entity_decode')) {
+     require_once ('PHP/Compat.php');
+ 
+     PHP_Compat::loadFunction ('html_entity_decode');
+ }
+ 
+ /**
  * Examines Comment according to Personal BLacklist
  *
***************
*** 39,43 ****
          */
          $regx = '(ftp|http|file)://([^/\\s]+)';
!         $num = preg_match_all("#{$regx}#",$comment,$urls);
  
          $result = DB_query("SELECT * FROM {$_TABLES['spamx']} WHERE name='IPofUrl'", 1);
--- 48,52 ----
          */
          $regx = '(ftp|http|file)://([^/\\s]+)';
!         $num = preg_match_all("#{$regx}#",html_entity_decode($comment),$urls);
  
          $result = DB_query("SELECT * FROM {$_TABLES['spamx']} WHERE name='IPofUrl'", 1);
***************
*** 64,66 ****
  }
  
! ?>
\ No newline at end of file
--- 73,75 ----
  }
  
! ?>

Index: BlackList.Examine.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/BlackList.Examine.class.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BlackList.Examine.class.php	18 Dec 2004 15:35:02 -0000	1.5
--- BlackList.Examine.class.php	20 Feb 2005 09:51:27 -0000	1.6
***************
*** 16,19 ****
--- 16,28 ----
  
  /**
+ * html_entity_decode is only available as of PHP 4.3.0
+ */
+ if (!function_exists ('html_entity_decode')) {
+     require_once ('PHP/Compat.php');
+ 
+     PHP_Compat::loadFunction ('html_entity_decode');
+ }
+ 
+ /**
   * Examines Comment according to Personal BLacklist
   * 
***************
*** 42,46 ****
              $A = DB_fetchArray($result);
              $val = $A['value'];
!             if (preg_match("#$val#", $comment)) {
                  $ans = 1; // quit on first positive match
                  SPAMX_log($LANG_SX00['foundspam'] . $val . $LANG_SX00['foundspam2'] . $_USER['uid'] . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
--- 51,55 ----
              $A = DB_fetchArray($result);
              $val = $A['value'];
!             if (preg_match("#$val#", html_entity_decode ($comment))) {
                  $ans = 1; // quit on first positive match
                  SPAMX_log($LANG_SX00['foundspam'] . $val . $LANG_SX00['foundspam2'] . $_USER['uid'] . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);

Index: MTBlackList.Examine.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/MTBlackList.Examine.class.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MTBlackList.Examine.class.php	18 Dec 2004 15:35:02 -0000	1.5
--- MTBlackList.Examine.class.php	20 Feb 2005 09:51:27 -0000	1.6
***************
*** 19,22 ****
--- 19,31 ----
  
  /**
+ * html_entity_decode is only available as of PHP 4.3.0
+ */
+ if (!function_exists ('html_entity_decode')) {
+     require_once ('PHP/Compat.php');
+ 
+     PHP_Compat::loadFunction ('html_entity_decode');
+ }
+ 
+ /**
   * Examines Comment according to MT-BLacklist
   * 
***************
*** 45,49 ****
              $A = DB_fetchArray($result);
              $val = $A['value'];
!             if (@preg_match("#$val#", $comment)) {
                  $ans = 1; // quit on first positive match
                  SPAMX_log($LANG_SX00['fsc'] . $val . $LANG_SX00['fsc1'] . $_USER['uid'] . $LANG_SX00['fsc2'] . $_SERVER['REMOTE_ADDR']);
--- 54,58 ----
              $A = DB_fetchArray($result);
              $val = $A['value'];
!             if (@preg_match("#$val#", html_entity_decode ($comment))) {
                  $ans = 1; // quit on first positive match
                  SPAMX_log($LANG_SX00['fsc'] . $val . $LANG_SX00['fsc1'] . $_USER['uid'] . $LANG_SX00['fsc2'] . $_SERVER['REMOTE_ADDR']);




More information about the geeklog-cvs mailing list