Skip to content
This repository was archived by the owner on Apr 3, 2018. It is now read-only.
This repository was archived by the owner on Apr 3, 2018. It is now read-only.

Are MediaHelper::embed()/embedAsObject() supposed to accept URLs? #74

@ndm2

Description

@ndm2

While working on a 2.x fork, I've stumbled over this little piece of code in MediaHelper::_sources():

if (strpos('://', $path['path']) !== false) {
    $file = parse_url($url, PHP_URL_PATH);
}

https://github.com/davidpersson/media/blob/5af3e2a6e2e85d985db222b058f0fef952b0bdf1/views/helpers/media.php#L551

It seems to check the path for being an URL, however an URL would never made it there, as MediaHelper::url() would return false for an URL (and if it made it there the strpos call would return false because the arguments are in the wrong order).

Despite the problems with this, I'm wondering what this code was supposed to do? Were MediaHelper::embed()/embedAsObject() supposed to accept URLs?

See also VolantisDev#44

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