Jump to content

Recommended Posts

Sorry, clearly I'm an imbecile - here it is:

 

	function wideban($address) 
{
	$this_ban = "*";
	$dot = explode(".", $address);
	foreach ($dot as $yah_dot_yah) 
	{			
		$numbers = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
		foreach ($numbers as $this_num) 
		{
			$pos = strpos($yah_dot_yah, $this_num);
			if ($pos === false) 
			{
				$num = FALSE; } else { $num = TRUE; $never_set = TRUE;
			}
		}
		if (!$num) 
		{
			$this_ban .= ".$yah_dot_yah"; $num = FALSE; 
		}		
	}

	if (!$never_set) 
	{
		$this_ban = "*";
		foreach ($dot as $this_dot) 
		{
			if ($first) 
			{
				$this_ban .= ".$this_dot"; 
			}
		$first = TRUE;
		}
	}
	return $this_ban;
}

um...something that makes no sense

Lets say you use it like this:

print wideban("www.google.com");

it returns "*.google.com"

if you use it like this:

print wideban("http://google.com");

it returns "*.com"

 

it doesn't handle IP addresses too well, though. if you put "127.0.0.1" it returns "*.127.0.0.1"

yeah...I looked at it, and looked at, and looked at it...and looked at it...and decided fuck it, who cares.  I don't really see how that function would really be useful for anything.  Not gonna jump the gun and say it isn't...I mean, I don't know the context for which it's in...but at the very least, it's very bloated...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.