[wp-trac] [WordPress Trac] #36822: srcset is added to <img /> even if media file is not present in media library

WordPress Trac noreply at wordpress.org
Thu May 12 10:13:05 UTC 2016


#36822: srcset is added to <img /> even if media file is not present in media
library
--------------------------+-------------------------------
 Reporter:  temmokan      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.5.2
 Severity:  normal        |   Keywords:  responsive, media
  Focuses:                |
--------------------------+-------------------------------
 Summary: if link to image ends with string like

 "YYYY/MM/filename.ext"

 and there are image files in MEdia library residing in

 /wp-content/upload/YYYY/MM

 then some of those files will be used to generate "responsive image"
 feature, adding srcset/sizes attributes

 Example 1: On Wordpress site http://example.com, document contains markup
 like

 <img src="/wp-content/uploads/YYYY/MM/filename.png">

 where the above file is *not* part of Media library (it just resides in
 that folder). srcset is added with link to (arbitrary selected?) image
 file within that folder.

 Expected behaviour: no srcset/sizes should be added.

 Example 2: On Wordpress site http://example.com, document contains markup
 like

 <img src="http://cdn.example.com/wp-content/uploads/YYYY/MM/filename.png">

 where cdn.example.com is *not* an alias for example.com, but altogether
 external resource

 Once again, srcset is added with link to (arbitrary selected?) image file
 within  folder YYYY/MM in Media library.

 Expected behaviour: no srcset/sizes should be added.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36822>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list