FAQ FAQ   Search Search   Memberlist Memberlist   Usergroups Usergroups   Register Register 
PhpBB- & WordPress- antispam.com
Home of the Antispam for all fields mod ! 
  Profile Profile   Log in to check your private messages Log in to check your private messages  Log inLog in 

 PhpBB- & WordPress- antispam.com Forum Index » [PhpBB2] Feature requests » is_encoded ( ) ...
  The time now is Tue Oct 17, 2017 11:15 pm 

 Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
PostPosted: Tue Dec 12, 2006 5:19 am    Post subject: is_encoded ( ) ...  Reply with quote  

A.I. BOT
Phpbb coder


Joined: 11 Dec 2006
Posts: 9
Location: Newfoundland, Canada

This is something I whipped up today to detect if something is urlencoded. Was woundering if you might get any use out of it for your mod, Ramon, for things where spammers use scripts or CURL, etc, to post topics, they often encode them to POST them. Just a feature request I guess, could help cut down on spammers.

Code:

<?php
$string         = 'HI I AM ! JOE# $!';
$encoded        = urlencode ( $string );

function is_encoded ( $string )
{
        preg_match ( '/%[0-9]{2}/ism', $string, $results );
        if ( count ( $results ) > 0 )
        {
                return true;
        }
        else
        {
                return false;
        }
}

print ( is_encoded ( $string ) == true ) ? 'Encoded!' : 'Not Encoded!';
print ( is_encoded ( $encoded ) == true ) ? 'Encoded!' : 'Not Encoded!';
?>


You should get: "Not Encoded! Encoded!".

TOP View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger  BOTTOM
PostPosted: Tue Dec 12, 2006 10:40 am    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

I'm not sure I follow you right here..

normally
Code:
HI I AM ! JOE# $!


will be read as

Code:
HI I AM! JOE!
HIIAM!JOE!


and some other variations...
_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
PostPosted: Tue Dec 12, 2006 2:25 pm    Post subject:  Reply with quote  

A.I. BOT
Phpbb coder


Joined: 11 Dec 2006
Posts: 9
Location: Newfoundland, Canada

If someone has a script to post to a forum, done in say javascript. The message they enter might need to be encoded so its gonna turn out something like: HI+I+AM+!+JOE%23+%24! .. it i will be read as HI I AM ! JOE# $!. I was just seeing if there way a way maybe to detect if somone is doing such a thing and block them from doing it ? not sure though, I might gone out to space with this.

TOP View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger  BOTTOM
 Post new topic   Reply to topic All times are GMT + 1 Hour

Display posts from previous:   
 PhpBB- & WordPress- antispam.com Forum Index » [PhpBB2] Feature requests » is_encoded ( ) ...
 
 Page 1 of 1
 
 
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Jump to:  


     Powered by phpBB © 2001, 2005 phpBB Group | Template Neon | Snelle Managed WordPress webhosting