Skip to content

getCode() is missing a case for imageHtml #293

@phptek

Description

@phptek

In embed/embed/src/Adaptors//File.php the getCode() method doesn't work properly for remote images.

As far as I can tell, there should be a clause for "imageHTML".

Adding the following clause to getCode() fixes the problem (Using v3.3.5 with PHP7.1)

    case 'imageHtml':
        return Utils::imageHtml($this->url,'', $this->imageWidth, $this->imageHeight);

This method's switch block is also missing a default. It should decide what is a suitable default to pass onto API consmers. Default to a dummy 1px x 1px image in an <img> element perhaps? Or throw an exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions