Changeset 47219 for trunk/src/wp-includes/pomo/po.php
- Timestamp:
- 02/09/2020 04:52:28 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/pomo/po.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/po.php
r47198 r47219 120 120 // Add empty string on first line for readbility. 121 121 if ( false !== strpos( $string, $newline ) && 122 ( substr_count( $string, $newline ) > 1 || ! ( $newline === substr( $string, -strlen( $newline ) ) )) ) {122 ( substr_count( $string, $newline ) > 1 || substr( $string, -strlen( $newline ) ) !== $newline ) ) { 123 123 $po = "$quote$quote$newline$po"; 124 124 } … … 295 295 break; 296 296 } 297 if ( $res['entry']->singular == '') {297 if ( '' == $res['entry']->singular ) { 298 298 $this->set_headers( $this->make_headers( $res['entry']->translations[0] ) ); 299 299 } else { … … 318 318 */ 319 319 protected static function is_final( $context ) { 320 return ( $context === 'msgstr' ) || ( $context === 'msgstr_plural');320 return ( 'msgstr' === $context ) || ( 'msgstr_plural' === $context ); 321 321 } 322 322 … … 348 348 } 349 349 } 350 if ( $line == "\n") {350 if ( "\n" === $line ) { 351 351 continue; 352 352 } … … 360 360 } 361 361 // Comments have to be at the beginning. 362 if ( $context && $context != 'comment') {362 if ( $context && 'comment' !== $context ) { 363 363 return false; 364 364 } … … 371 371 break; 372 372 } 373 if ( $context && $context != 'comment') {373 if ( $context && 'comment' !== $context ) { 374 374 return false; 375 375 } … … 382 382 break; 383 383 } 384 if ( $context && $context != 'msgctxt' && $context != 'comment') {384 if ( $context && 'msgctxt' !== $context && 'comment' !== $context ) { 385 385 return false; 386 386 } … … 388 388 $entry->singular .= PO::unpoify( $m[1] ); 389 389 } elseif ( preg_match( '/^msgid_plural\s+(".*")/', $line, $m ) ) { 390 if ( $context != 'msgid') {390 if ( 'msgid' !== $context ) { 391 391 return false; 392 392 } … … 395 395 $entry->plural .= PO::unpoify( $m[1] ); 396 396 } elseif ( preg_match( '/^msgstr\s+(".*")/', $line, $m ) ) { 397 if ( $context != 'msgid') {397 if ( 'msgid' !== $context ) { 398 398 return false; 399 399 } … … 401 401 $entry->translations = array( PO::unpoify( $m[1] ) ); 402 402 } elseif ( preg_match( '/^msgstr\[(\d+)\]\s+(".*")/', $line, $m ) ) { 403 if ( $context != 'msgid_plural' && $context != 'msgstr_plural') {403 if ( 'msgid_plural' !== $context && 'msgstr_plural' !== $context ) { 404 404 return false; 405 405 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)