Making WordPress.org

Changeset 11315


Ignore:
Timestamp:
11/05/2021 05:03:11 AM (3 years ago)
Author:
dd32
Message:

Translate: Custom Warnings: Partially revert [11314] in favour of the upstream changes.

See https://github.com/GlotPress/GlotPress-WP/pull/1271.
See #5927.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-warnings/wporg-gp-custom-warnings.php

    r11314 r11315  
    281281        if ( $is_sprintf ) {
    282282            // Negative/Positive lookahead not used to allow the warning to include the context around the % sign.
    283             preg_match_all( '/(?P<context>[^\s%]*)%((\d+\$(?:\d+)?)?(\.\d+)?(?P<char>.))/i', $translation, $m );
     283            preg_match_all( '/(?P<context>[^\s%]*)%((\d+\$(?:\d+)?)?(?P<char>.))/i', $translation, $m );
    284284
    285285            foreach ( $m['char'] as $i => $char ) {
    286                 if (
    287                     // % is included for escaped %%.
    288                     false === strpos( 'bcdefgosux%l', $char ) &&
    289                     // Check the "placeholder" doesn't exist within the original, as an extra safety mechanism.
    290                     false === strpos( $original, $m[0][ $i ] )
    291                 ) {
     286                // % is included for escaped %%.
     287                if ( false === strpos( 'bcdefgosux%l.', $char ) ) {
    292288                    $unexpected_tokens[] = $m[0][ $i ];
    293289                }
Note: See TracChangeset for help on using the changeset viewer.