Problem/Motivation

I have a site with user generated content and found a page throwing a 500 server error. The cause turns out to be a user that entered an img-tag with "///C:/Users/laro1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg" as the src value. Probably an attempt to include an image from their local system. This results in an InvalidArgumentException being thrown from UrlHelper::externalIsLocal() stating "A path was passed when a fully qualified domain was expected."

Steps to reproduce

Enter an img-tag with an invalid src-value (probably the above).

Proposed resolution

Catch and log the exception.

Remaining tasks

Create an MR.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork klaro-3586970

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eelkeblok created an issue. See original summary.

eelkeblok’s picture

Status: Active » Needs review

I also added blocking the URL when blocking unknown URLs is enabled.

jan kellermann made their first commit to this issue’s fork.

jan kellermann’s picture

Thank you very much. Just fixed a small DCS. Waiting for RTBC. Maybe we can add a test instead?

jan kellermann’s picture

I added a test. Need someone for RTBC please.

eelkeblok’s picture

Test looks good. I had to dig a little to find the result. Love how you just took my example, my user will be made immortal in open source code :) I don't have permission to run the test-only pipeline, maybe that would be a good final verification of the test.

jan kellermann’s picture

The result of the test-only pipeline:
https://git.drupalcode.org/project/klaro/-/jobs/10320548

eelkeblok’s picture

Status: Needs review » Reviewed & tested by the community

I'd say this is good for RTBC then.

jan kellermann’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 3.1.0

Thank you for your great work!

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.