Skip to content

Meta Refresh #9

@mdf092

Description

@mdf092

Hi
Thanks for your wonderful code.
As there is in code on line 418, in some contents, there is head and body, and also meta tag with Refresh. The code doesn't detect such a tag.
I this, it could be replace with this one and omit if clause:

#if redirect in meta tag found then redirect
$meta_refresh_tag = $html_dom->find('meta[http-equiv=refresh]', 0);
if (isset($meta_refresh_tag->content) &&
        preg_match('/^\s*(\d+)\s*;\s*URL=(.*)/i', $meta_refresh_tag->content, $matches)) {
        if (!$matches[1] <= 2) {
            $result->setRedirectTarget($this->fullyQualifyURI($matches[2], $url));
        }
    $this->closeHTMLDOM();
    return $result;                 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions