Changeset 11314
- Timestamp:
- 11/05/2021 04:55:21 AM (3 years ago)
- 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
r11198 r11314 281 281 if ( $is_sprintf ) { 282 282 // 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+)?)?( ?P<char>.))/i', $translation, $m );283 preg_match_all( '/(?P<context>[^\s%]*)%((\d+\$(?:\d+)?)?(\.\d+)?(?P<char>.))/i', $translation, $m ); 284 284 285 285 foreach ( $m['char'] as $i => $char ) { 286 // % is included for escaped %%. 287 if ( false === strpos( 'bcdefgosux%l', $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 ) { 288 292 $unexpected_tokens[] = $m[0][ $i ]; 289 293 } … … 316 320 // l is included for wp_sprintf_l()'s custom %l format. 317 321 // @ is included for Swift (as used for iOS mobile app) %@ string format. 318 return '(?<!%)%(\d+\$(?:\d+)?)? [bcdefgosuxEFGX%l@]';322 return '(?<!%)%(\d+\$(?:\d+)?)?(\.\d+)?[bcdefgosuxEFGX%l@]'; 319 323 } ); 320 324 }
Note: See TracChangeset
for help on using the changeset viewer.