src/MediaEmbed.php
protected function _parseLink($url, $regex) {
		$context = stream_context_create(
			['http' => ['header' => 'Connection: close']]);
		$content = file_get_contents($url, false, $context);
		if (!$content) {
			return false;
		}

		$source = preg_replace('/[^(\x20-\x7F)]*/', '', $content);

		if (preg_match('~' . $regex . '~imu', $source, $match)) {
			$this->_match = $match;
			return true;
		}

		return false;
	}
protected function _parseLink($url, $regex) {
		$context = stream_context_create(
			['http' => ['header' => 'Connection: close']]);
		$content = file_get_contents($url, false, $context);
		if (!$content) {
			return false;
		}

		$source = preg_replace('/[^(\x20-\x7F)]*/', '', $content);

		if (preg_match('~' . $regex . '~imu', $source, $match)) {
			$this->_match = $match;
			return true;
		}

		return false;
	}
protected function _parseLink ( $ url , $ regex ) { $ context = stream_context_create ( [ 'http' => [ 'header' => 'Connection: close' ] ] ) ; $ content = file_get_contents ( $ url , false , $ context ) ; if ( ! $ content ) { return false ; } $ source = preg_replace ( '/[^(\x20-\x7F)]*/' , '' , $ content ) ; if ( preg_match ( '~' . $ regex . '~imu' , $ source , $ match ) ) { $ this -> _match = $ match ; return true ; } return false ; }
Attempt to parse the embed id from a given URL

@param string $url
@param string $regex
@return bool
Attempt to parse the embed id from a given URL