Make WordPress Core

Opened 2 years ago

Last modified 14 months ago

#55872 reopened defect (bug)

wp_image_add_srcset_and_sizes trys to parse images from external pages, fails with error

Reported by: pampfelimetten's profile pampfelimetten Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Media Keywords:
Focuses: Cc:

Description

If a user embeds image content from another domain by copy pasting and includes a tag like

<img class="wp-image-199052" srs="externaldomain...">

it seems like wordpress trys to parse the file as it were hosted in its own instance. This won't work of course, because it cannot access the file in the filesystem. It then fails with the following warning:

PHP Warning:  Undefined array key "file" in /wp-includes/media.php on line 1676"

Change History (3)

#1 @salihonder
2 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Hello.
This looks strange. How do you add the image? Not as html code?
We could get this error when we add it as attachment. Can you share a screenshot from added code?
I want to experience this error and apply its solution. But when I try, I don't see any error.

#2 @pampfelimetten
23 months ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Hi, reopening, because the error still persists.
Ah, whats probably important to know is, that its a page without the gutenberg editor, so its the old default tinymce editor. It probably happens when a user copies a picture from another wp instance on another domain into our wp instance.
Here is the full code:

[caption id="attachment_199052" align="alignleft" width="262"]<a href="https://radiofabrik.at/wp-content/uploads/2022/05/Micha-Hoppe-interviewt-Hr.-Reithofer.jpg"><img class="wp-image-199052" src="https://radiofabrik.at/wp-content/uploads/2022/05/Micha-Hoppe-interviewt-Hr.-Reithofer-300x264.jpg" alt="" width="262" height="230" /></a> Was macht den Mobility Point in Salzburg aus? Dazu Micha Hoppe im Gespräch mit Josef Reithofer. Bild: Radiofabrik/Monika Daoudi[/caption]

Note: The domain radiofabrik.at is not our own, this is the external domain.

#3 @pampfelimetten
14 months ago

We still have this problem. What can I do so that a core developer takes a look at this?

Note: See TracTickets for help on using tickets.