Recent Topics

Bypassing the blacklist when posting

Started by on Oct 11, 2005 – Contents updated: Oct 11, 2005

Oct 11, 2005 13:14    

This isn't a very good hack, but it works. It should tell you that you're trying to post a url with a banned keyword and ask you if you really want to, but all it does is let it go through if the blogger is a high enough level. Pretty simple I guess. Open b2evocore/_functions.php and find this bit:

	// Search for blocked URLs:
	if( $block = antispam_check($url) )
	{
		if( $debug ) return 'Url refused. Debug info: blacklisted word: ['.$block.']';
		return T_('URL not allowed');
	}

Replace it with this:

	// Search for blocked URLs:
	if( $block = antispam_check($url) )
	{
		if( is_logged_in() ) { // check if it's a member
			global $current_User;
			if( $current_User->get('level') >= 5 ) { // minimum user level required
				$do_nothing = true; // ain't no problem!
				}
			} else { // better not trust this one!
			if( $debug ) return 'Url refused. Debug info: blacklisted word: ['.$block.']';
			return T_('URL not allowed');
			}
	}


I guess you could set the minimum user level required to 1, but then you could just remove the inner-most if - like this:

	// Search for blocked URLs:
	if( $block = antispam_check($url) )
	{
		if( is_logged_in() ) { // check if it's a member
			$do_nothing = true; // ain't no problem!
			} else { // better not trust this one!
			if( $debug ) return 'Url refused. Debug info: blacklisted word: ['.$block.']';
			return T_('URL not allowed');
			}
	}


Form is loading...

Social CMS software – This forum is powered by b2evolution CMS, a complete engine for your website.