Problem/Motivation

The VideoDerivative and VideoPoster value objects accept any string as URL, and the field formatters have no failure handling around provider calls. When a provider returns a malformed value, for example an upstream SDK error payload, it is rendered verbatim into the src and poster attributes, and a throwing provider breaks the whole render.

Steps to reproduce

  1. Let a provider return a non-URL string as derivative or poster URL.
  2. Render the file: the string ends up as the <source src> or poster attribute.

Proposed resolution

Validate URLs in the value object constructors (core UrlHelper based; absolute or root-relative, protocol-relative rejected) and throw \InvalidArgumentException for anything else. Let the formatters catch provider failures, log them to a new video_style logger channel, and degrade gracefully: deliver the local file, skip the poster, or use the stored thumbnail.

Remaining tasks

Review and merge the prepared fix.

User interface changes

None

API changes

VideoDerivative and VideoPoster constructors now throw \InvalidArgumentException for invalid URLs. New internal UrlValidator value object and new logger.channel.video_style service.

Data model changes

None

Comments

dpacassi created an issue. See original summary.

  • dpacassi committed 8f82ff86 on 1.0.x
    Issue #3616656 by dpacassi: Invalid provider URLs can reach the rendered...
dpacassi’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.