rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -128,7 +128,7 @@ if ( ! class_exists( 'PO', false ) ) :
$po = $quote . implode( "{$slash}n{$quote}{$newline}{$quote}", explode( $newline, $input_string ) ) . $quote;
// Add empty string on first line for readbility.
if ( false !== strpos( $input_string, $newline ) &&
if ( str_contains( $input_string, $newline ) &&
( substr_count( $input_string, $newline ) > 1 || substr( $input_string, -strlen( $newline ) ) !== $newline ) ) {
$po = "$quote$quote$newline$po";
}
@@ -505,10 +505,10 @@ if ( ! class_exists( 'PO', false ) ) :
* @return string
*/
public static function trim_quotes( $s ) {
if ( '"' === substr( $s, 0, 1 ) ) {
if ( str_starts_with( $s, '"' ) ) {
$s = substr( $s, 1 );
}
if ( '"' === substr( $s, -1, 1 ) ) {
if ( str_ends_with( $s, '"' ) ) {
$s = substr( $s, 0, -1 );
}
return $s;