[wp-trac] [WordPress Trac] #55786: Thickbox gallery does not recognize webp images

WordPress Trac noreply at wordpress.org
Sat May 21 11:24:02 UTC 2022


#55786: Thickbox gallery does not recognize webp images
--------------------------+-----------------------------
 Reporter:  ilunabar      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.9.3
 Severity:  normal        |   Keywords:  has-patch
  Focuses:  javascript    |
--------------------------+-----------------------------
 -- The line of code 79 of /wp-includes/js/thickboxthickbox.js is:

 var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;


 -- It should be something like this:

 var urlString = /\.webp|\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;


 -----------------


 The line of code 82 of /wp-includes/js/thickboxthickbox.js is:

 if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType
 == '.gif' || urlType == '.bmp'){//code to show images


 -- It should be something like this:

 if(urlType == '.webp' || urlType == '.jpg' || urlType == '.jpeg' ||
 urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to
 show images


 I hope this will help.

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


More information about the wp-trac mailing list