original_string: protected function enabled($url) {
  		$web=Web::instance();
  		$req=$web->request($url);
  		$found=FALSE;
  		if ($req && $req['body']) {
  			// Look for pingback header
  			foreach ($req['headers'] as $header)
  				if (preg_match('/^X-Pingback:\h*(.+)/',$header,$href)) {
  					$found=$href[1];
  					break;
  				}
  			if (!$found &&
  				// Scan page for pingback link tag
  				preg_match('/<link\h+(.+?)\h*\/?>/i',$req['body'],$parts) &&
  				preg_match('/rel\h*=\h*"pingback"/i',$parts[1]) &&
  				preg_match('/href\h*=\h*"\h*(.+?)\h*"/i',$parts[1],$href))
  				$found=$href[1];
  		}
  		return $found;
  	}
code: protected function enabled($url) {
  		$web=Web::instance();
  		$req=$web->request($url);
  		$found=FALSE;
  		if ($req && $req['body']) {
  			// Look for pingback header
  			foreach ($req['headers'] as $header)
  				if (preg_match('/^X-Pingback:\h*(.+)/',$header,$href)) {
  					$found=$href[1];
  					break;
  				}
  			if (!$found &&
  				// Scan page for pingback link tag
  				preg_match('/<link\h+(.+?)\h*\/?>/i',$req['body'],$parts) &&
  				preg_match('/rel\h*=\h*"pingback"/i',$parts[1]) &&
  				preg_match('/href\h*=\h*"\h*(.+?)\h*"/i',$parts[1],$href))
  				$found=$href[1];
  		}
  		return $found;
  	}
code_tokens: protected function enabled ( $ url ) { $ web = Web :: instance ( ) ; $ req = $ web -> request ( $ url ) ; $ found = FALSE ; if ( $ req && $ req [ 'body' ] ) { // Look for pingback header foreach ( $ req [ 'headers' ] as $ header ) if ( preg_match ( '/^X-Pingback:\h*(.+)/' , $ header , $ href ) ) { $ found = $ href [ 1 ] ; break ; } if ( ! $ found && // Scan page for pingback link tag preg_match ( '/<link\h+(.+?)\h*\/?>/i' , $ req [ 'body' ] , $ parts ) && preg_match ( '/rel\h*=\h*"pingback"/i' , $ parts [ 1 ] ) && preg_match ( '/href\h*=\h*"\h*(.+?)\h*"/i' , $ parts [ 1 ] , $ href ) ) $ found = $ href [ 1 ] ; } return $ found ; }
docstring: Return TRUE if URL points to a pingback-enabled resource
  @return bool
  @param $url
docstring_tokens: Return TRUE if URL points to a pingback - enabled resource