Making WordPress.org


Ignore:
Timestamp:
05/06/2021 02:21:54 AM (6 years ago)
Author:
dd32
Message:

Translate: Custom Warnings: Improve the regular expression for printf placeholder matches.

This trials ​https://github.com/GlotPress/GlotPress-WP/pull/1237 on WordPress.org

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

    r10946 r10955  
    309309                        GP::$translation_warnings->add( str_replace( 'warning_', '', $warning ), array( $this, $warning ) );
    310310                }
     311
     312                // https://github.com/GlotPress/GlotPress-WP/pull/1237
     313                add_filter( 'gp_warning_placeholders_re', function( $re ) {
     314                        if ( '%(\d+\$(?:\d+)?)?[bcdefgosuxEFGX]' === $re ) {
     315                                $re = '(?<!%)%(\d+\$(?:\d+)?)?[bcdefgosuxEFGX%]';
     316                        }
     317                        return $re;
     318                } );
    311319        }
    312320
Note: See TracChangeset for help on using the changeset viewer.