Making WordPress.org

Changeset 12568


Ignore:
Timestamp:
05/02/2023 03:51:26 AM (3 years ago)
Author:
dd32
Message:

Support Forums: Blocks: When an emoji svg fallback is copied, Guteberg sometimes removes the img.emoji class, which causes the paste to break and the existing server-side fixes to fail to correct it.

See #6964.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php

    r12567 r12568  
    310310        // Replace all img.emoji with the alt text.
    311311        $content = preg_replace(
    312             '~<img[^>]+class="emoji"[^>]+alt="(.*?)"+[^>]+>(</img>)?~iu',
     312            '~<img[^>]+class="emoji"[^>]+alt="(.*?)"+[^>]+>(\s*</img>)?~iu',
     313            '$1',
     314            $content
     315        );
     316
     317        // Replace all emoji svgs with the alt text, for when the emoji class has been stripped.
     318        $content = preg_replace(
     319            '~<img[^>]+alt="(.*?)"+[^>]+s\.w\.org/images/core/emoji[^>]+>(\s*</img>)?~iu',
    313320            '$1',
    314321            $content
Note: See TracChangeset for help on using the changeset viewer.