From f2151a204724c2b9e4a88df07e35204bab9b727f Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Wed, 18 Aug 2021 20:44:35 +0200
Subject: [PATCH] Pomo/ PHP 8.1: improve the fix for `auto_detect_line_endings`
... as per the inline comment.
---
src/wp-includes/pomo/po.php | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/wp-includes/pomo/po.php b/src/wp-includes/pomo/po.php
index 22b94c11bf..6e1aca0f75 100644
|
a
|
b
|
if ( ! defined( 'PO_MAX_LINE_LEN' ) ) {
|
| 13 | 13 | define( 'PO_MAX_LINE_LEN', 79 ); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | | // This setting has been deprecated in PHP 8.1. |
| 17 | | if ( PHP_VERSION_ID < 80100 ) { |
| 18 | | ini_set( 'auto_detect_line_endings', 1 ); |
| 19 | | } |
| | 16 | /* |
| | 17 | * The `auto_detect_line_endings` setting has been deprecated in PHP 8.1, |
| | 18 | * but will continue to work until PHP 9.0. |
| | 19 | * For now, we're silencing the deprecation notice as there may still be |
| | 20 | * translation files around which haven't been updated in a long time and |
| | 21 | * which still use the old MacOS stand-alone `\r` as a line-ending. |
| | 22 | * This fix should be revisited when PHP 9.0 is in alpha/beta. |
| | 23 | */ |
| | 24 | @ini_set( 'auto_detect_line_endings', 1 ); |
| 20 | 25 | |
| 21 | 26 | /** |
| 22 | 27 | * Routines for working with PO files |