Return favicon of the page you want to blog card

@param string $content
@return string
193678
protected function _get_favicon( $content ) {
		preg_match( '/<link +?rel=["\']shortcut icon["\'][^\/>]*? href=["\']([^"\']+?)["\'][^\/>]*?\/?>/si', $content, $reg );
		if ( empty( $reg[1] ) ) {
			preg_match( '/<link +?rel=["\']icon["\'][^\/>]*? href=["\']([^"\']+?)["\'][^\/>]*?\/?>/si', $content, $reg );
		}

		if ( empty( $reg[1] ) ) {
			return;
		}

		$favicon = $reg[1];
		$favicon = $this->_relative_path_to_url( $favicon, $content );

		if ( is_ssl() ) {
			$favicon = preg_replace( '|^http:|', 'https:', $favicon );
		}

		$requester = new Requester( $favicon );
		$response  = $requester->request( $favicon );
		if ( is_wp_error( $response ) ) {
			return;
		}

		$status_code = $requester->get_status_code();
		if ( 200 != $status_code && 304 != $status_code ) {
			return;
		}

		return $favicon;
	}
661344
public function favicon($url)
    {
        return $url ? $this->router->generate('media_favicon', ['host' => parse_url($url, PHP_URL_HOST)]) : false;
    }
720332
protected function getEOL($content)
    {
        static $eols = [
            "\r\n",
            "\n",
            "\r",
        ];
        foreach($eols as $eol)
        {
            if(strpos($content, $eol))
            {
                return $eol;
            }
        }
        return PHP_EOL;
    }
769262
protected function bbCodesHandle($content) {
		$bbCodes = $this->getTagsLocator();
		
		return preg_replace_callback('~\[([a-z]+)\](.*?)\[/\1\]~', function($match) use($bbCodes) {
			array_shift($match);
			list($tag, $value) = $match;
			
			if (preg_match('~\[[a-z]+\]~', $value)) {
				$value = $this->bbCodesHandle($value);
			}
			
			if ($bbCodes->has($tag)) {
				return $bbCodes->get($tag)->render($value);
			}
			
			return $value;
		}, $content);
	}
860397
protected function reviseStyle( $content )
	{
		if( $this->protocol == self::PROTOCOL_HTTP )
		{
			$content	= str_ireplace( "https://", "http://", $content );
		}
		else if( $this->protocol == self::PROTOCOL_HTTPS )
		{
			$content	= str_ireplace( "http://", "https://", $content );
		}
		return $content;
	}
931456
protected function materialDesignIconicFontListIcon($icon, $content) {

        $glyphicon = null !== $icon ? StringHelper::replace($icon, ["class=\"zmdi"], ["class=\"zmdi-hc-li zmdi"]) : "";
        $innerHTML = null !== $content ? $content : "";

        return static::coreHTMLElement("li", $glyphicon . $innerHTML);
    }
372083
public function doShortcode($content)
    {
        if (false === strpos($content, '[')) {
            return $content;
        }

        if (empty($this->_shortcodes) || !is_array($this->_shortcodes))
            return $content;

        /**
         * Clear content from ignore blocks
         */
        $pattern = $this->getIgnorePattern();
        $content = preg_replace_callback("~$pattern~isu", ['self', '_stack'], $content);

        /**
         * parse nested
         */
        $content = $this->parseContent($content);

        /**
         * Replase shorcodes in content
         */
        $content = strtr($content, self::_stack());

        return $content;
    }
1234063
public function renderContainer($content = null)
    {
        if ($this->UseContainer) {
            
            return sprintf(
                "<div class=\"%s\">\n<div class=\"%s\">\n%s</div>\n</div>\n",
                $this->getContainerClass(),
                $this->getHTMLClass(),
                $content
            );
            
        }
        
        return $content;
    }
640716
public function strip($content)
    {
        if (empty($this->registered)) {
            return $content;
        }
        $pattern = $this->getRegex();

        return preg_replace_callback("/{$pattern}/s", [$this, 'stripTag'], $content);
    }
928132
protected function getPages($content)
    {
        if ($content instanceof Pages) {
            return $content;
        }
        elseif ($content instanceof Site) {
            return $content->index();
        }
        else {
            $pages = new Pages([]);
            if ($content instanceof Page) $pages->add($content);
            return $pages;
        }
    }
869204
public static function getStreamExt($content)
    {
        $finfo = new finfo(FILEINFO_MIME);

        $mime = $finfo->buffer($content);

        return isset(self::$extensionMap[$mime]) ? self::$extensionMap[$mime] : '';
    }
1350532
protected function _getPaddedLine($content)
    {
        if (!is_array($content)) $content = array( $content );
        if ($this->column_size===0 && $this->line_size===0 && $this->cell_size===0) {
            $this->_parseTableSizes();
        }
        if (count($content) > $this->getColumnSize()) {
            $this->_repadAllLines();
        } elseif (count($content) < $this->getColumnSize() && ($this->getPadFlag() & self::PAD_BY_EMPTY_CELLS)) {
            $content = array_pad($content, $this->getColumnSize(), '');
        }
        return $content;
    }
259456
protected function renderLayout(string $content): string
    {
        $content = str_replace('<!-- extends "' . $this->layout . '" -->', '', $content);
        $content = trim($content);
        $this->assign(['content' => $content]);
        $layoutFile = $this->pathLayouts . '/' . $this->layout . '.phtml';
        return $this->renderFile($layoutFile);
    }
33416
private function getFirstBlock($content)
    {
        $lines = preg_split('/\r\n|\n/', $content);
        $block = [];
        $found = false;

        foreach ($lines as $line) {
            $line = trim($line);
            if (!$line && $found === true) {
                break;
            }

            $found   = true;
            $block[] = $line;
        }

        return implode(' ', $block);
    }
582656
protected function retrieveH5P( $content ) {
		if ( $this->sourceHasH5pApi && $this->targetHasH5pApi ) {
			// Download H5P
			$h5p_ids = $this->downloads->h5p( $content );
			foreach ( $h5p_ids as $h5p_id ) {
				if ( str_starts_with( $h5p_id, '#fixme' ) ) {
					// Flag problem, remove broken H5P shortcode
					$this->targetHasFetchedAllTheH5p = false;
					$h5p_id = str_remove_prefix( $h5p_id, '#fixme' );
					$content = $this->h5p->replaceUncloneable( $content, $h5p_id );
				} else {
					$this->clonedItems['h5p'][] = $h5p_id;
				}
			}
		} else {
			// Remove all H5P shortcodes
			$content = $this->h5p->replaceUncloneable( $content );
		}
		return $content;
	}
509813
public function siteIconUrl($domain) {
		if (strpos($domain, 'http') === 0) {
			// Strip protocol
			$pieces = parse_url($domain);
			$domain = $pieces['host'];
		}
		return 'http://www.google.com/s2/favicons?domain=' . $domain;
	}
1072903
public static function buildAndGetPage(string $content) :string {
		// initial content
		$page = '<!doctype html><html lang="'.\Polyfony\Locales::getLanguage().'"><head><title>'.(isset(self::$_metas['title']) ? self::$_metas['title'] : '').'</title><meta http-equiv="content-type" content="text/html; charset=' . \Polyfony\Response::getCharset() . '" />';
		// add the meta tags and the links
		$page .= self::buildMetasTags() . self::buildLinksTags();
		// close the head, add the body, and add the scripts
		$page .= '</head><body>' . $content . self::buildScriptsTags();
		// add the profiler (if enabled)
		$page .= \Polyfony\Config::get('profiler', 'enable') ? new \Polyfony\Profiler\HTML : '';
		// close the document and return the assembled html page
		return $page . '</body></html>';

	}