[wp-trac] [WordPress Trac] #52413: srcset attribute is beeing removed when using user role editor

WordPress Trac noreply at wordpress.org
Mon Feb 1 10:40:18 UTC 2021


#52413: srcset attribute is beeing removed when using user role editor
--------------------------+-----------------------------
 Reporter:  charles101    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi Folks

 I have an issue with the user role editor. The attribute srcset is being
 removed magically from the rendering.

 Try this out as non admin user:

 {{{
 <img src="feuerwehr-320.jpg" srcset="feuerwehr-640.jpg 2x,
 feuerwehr-960.jpg 3x, feuerwehr-1280.jpg 4x">
 }}}


 This is the rendered response with the missing srcset attribute.

 {{{
 {
         "id": 181,
         "date": "2021-02-01T10:05:29",
         "date_gmt": "2021-02-01T10:05:29",
         "guid": {
                 "rendered": "http://woocommerce.wordpress.test/ch-
 de/?page_id=181",
                 "raw": "http://woocommerce.wordpress.test/ch-
 de/?page_id=181"
         },
         "modified": "2021-02-01T10:05:29",
         "modified_gmt": "2021-02-01T10:05:29",
         "password": "",
         "slug": "",
         "status": "draft",
         "type": "page",
         "link": "http://woocommerce.wordpress.test/ch-de/?page_id=181",
         "title": { "raw": "test", "rendered": "test" },
         "content": {
                 "raw": "<img src=\"feuerwehr-320.jpg\">",
                 "rendered": "<p><img src=\"feuerwehr-320.jpg\"></p>\n",
                 "protected": false,
                 "block_version": 0
         },
         "excerpt": { "raw": "", "rendered": "", "protected": false },
         "author": 2,
         "featured_media": 0,
         "parent": 0,
         "menu_order": 0,
         "comment_status": "closed",
         "ping_status": "closed",
         "template": "",
         "meta": [],
         "permalink_template": "http://woocommerce.wordpress.test/ch-
 de/%pagename%/",
         "generated_slug": "test",
         "_links": {
                 "self": [
                         {
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/pages/181"
                         }
                 ],
                 "collection": [
                         { "href": "http://woocommerce.wordpress.test/ch-de
 /wp-json/wp/v2/pages" }
                 ],
                 "about": [
                         {
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/types/page"
                         }
                 ],
                 "author": [
                         {
                                 "embeddable": true,
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/users/2"
                         }
                 ],
                 "replies": [
                         {
                                 "embeddable": true,
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/comments?post=181"
                         }
                 ],
                 "version-history": [
                         {
                                 "count": 19,
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/pages/181/revisions"
                         }
                 ],
                 "predecessor-version": [
                         {
                                 "id": 204,
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/pages/181/revisions/204"
                         }
                 ],
                 "wp:attachment": [
                         {
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/media?parent=181"
                         }
                 ],
                 "wp:action-publish": [
                         {
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/pages/181"
                         }
                 ],
                 "wp:action-assign-author": [
                         {
                                 "href": "http://woocommerce.wordpress.test
 /ch-de/wp-json/wp/v2/pages/181"
                         }
                 ],
                 "curies": [
                         { "name": "wp", "href": "https://api.w.org/{rel}",
 "templated": true }
                 ]
         }
 }
 }}}

 As admin this action is working fine, need to be something with the
 sanitize function.

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


More information about the wp-trac mailing list