Skip to content

Including remote images #9

@mhawker

Description

@mhawker

The is_file check on line 103 prevents the inclusion of remote files (eg, over http). However, file_get_contents will return false if either of the checks in line 103 fail. What do you think of changing base64($file) to read:

protected function base64($file)
{
    if (false === ($content = file_get_contents($file))) {
        throw new \InvalidArgumentException(sprintf('Cannot read file %s', $file));        
    }
    return base64_encode($file);
}

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