Changeset 47808 for trunk/src/wp-includes/pomo/po.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/po.php
r47219 r47808 150 150 foreach ( $chars as $char ) { 151 151 if ( ! $previous_is_backslash ) { 152 if ( '\\' == $char ) {152 if ( '\\' === $char ) { 153 153 $previous_is_backslash = true; 154 154 } else { … … 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 { … … 461 461 static $last_line = ''; 462 462 static $use_last_line = false; 463 if ( 'clear' == $action ) {463 if ( 'clear' === $action ) { 464 464 $last_line = ''; 465 465 return true; 466 466 } 467 if ( 'put-back' == $action ) {467 if ( 'put-back' === $action ) { 468 468 $use_last_line = true; 469 469 return true; 470 470 } 471 471 $line = $use_last_line ? $last_line : fgets( $f ); 472 $line = ( "\r\n" == substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line;472 $line = ( "\r\n" === substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line; 473 473 $last_line = $line; 474 474 $use_last_line = false; … … 483 483 $first_two = substr( $po_comment_line, 0, 2 ); 484 484 $comment = trim( substr( $po_comment_line, 2 ) ); 485 if ( '#:' == $first_two ) {485 if ( '#:' === $first_two ) { 486 486 $entry->references = array_merge( $entry->references, preg_split( '/\s+/', $comment ) ); 487 } elseif ( '#.' == $first_two ) {487 } elseif ( '#.' === $first_two ) { 488 488 $entry->extracted_comments = trim( $entry->extracted_comments . "\n" . $comment ); 489 } elseif ( '#,' == $first_two ) {489 } elseif ( '#,' === $first_two ) { 490 490 $entry->flags = array_merge( $entry->flags, preg_split( '/,\s*/', $comment ) ); 491 491 } else { … … 499 499 */ 500 500 public static function trim_quotes( $s ) { 501 if ( substr( $s, 0, 1 ) == '"') {501 if ( '"' === substr( $s, 0, 1 ) ) { 502 502 $s = substr( $s, 1 ); 503 503 } 504 if ( substr( $s, -1, 1 ) == '"') {504 if ( '"' === substr( $s, -1, 1 ) ) { 505 505 $s = substr( $s, 0, -1 ); 506 506 }
Note: See TracChangeset
for help on using the changeset viewer.