Bramus\MCS\DOMDocument::extractMixedContentUrls PHP Method

extractMixedContentUrls() public method

    public function extractMixedContentUrls()
    {
        // Array holding all URLs which are found to be Mixed Content
        // We'll return this one at the very end
        $mixedContentUrls = [];
        // Loop through all the tags and attributes we want to find
        // references to mixed content
        foreach ($this->tags as $tag => $attributes) {
            foreach ($this->getElementsByTagName($tag) as $el) {
                foreach ($attributes as $attribute) {
                    if ($el->hasAttribute($attribute)) {
                        $url = $el->getAttribute($attribute);
                        if (stripos($url, 'http://') !== false) {
                            $mixedContentUrls[] = $url;
                        }
                    }
                }
            }
        }
        // Return found URLs
        return $mixedContentUrls;
    }