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
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
Comment #3
eelkeblokI also added blocking the URL when blocking unknown URLs is enabled.
Comment #5
jan kellermann commentedThank you very much. Just fixed a small DCS. Waiting for RTBC. Maybe we can add a test instead?
Comment #6
jan kellermann commentedI added a test. Need someone for RTBC please.
Comment #7
eelkeblokTest 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.
Comment #8
jan kellermann commentedThe result of the test-only pipeline:
https://git.drupalcode.org/project/klaro/-/jobs/10320548
Comment #9
eelkeblokI'd say this is good for RTBC then.
Comment #11
jan kellermann commentedFixed in 3.1.0
Thank you for your great work!