[wp-trac] [WordPress Trac] #59597: Fix: Stop crashing with Lightbox on image blocks without an image.

WordPress Trac noreply at wordpress.org
Wed Oct 11 13:11:42 UTC 2023


#59597: Fix: Stop crashing with Lightbox on image blocks without an image.
--------------------------+-----------------------------
 Reporter:  dmsnell       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
--------------------------+-----------------------------
 Resolves WordPress/gutenberg#55217

 When rendering images with the lightbox "expand on click" function
 enabled, if an image block is encountered with no image (for example, a
 block was added but no image was ever selected), then WordPress would
 create a warning that an "undefined array key 0" was being accessed
 because the server code assumes an IMG element exists in the block's HTML.

 In this patch a check is performed to ensure that an IMG block exists
 before processing the block. If one isn't, for any reason, the original
 given HTML for the block is passed through un-modified.

 This patch needs to be backported into Gutenberg from where it's sourced
 but this issue arose during the WordPress 6.4 beta testing and needs to be
 resolved immediately in Core.

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


More information about the wp-trac mailing list