WordPress.org

Make WordPress Core

Ticket #53635: 53635-06-improve-auto_detect_line_endings-fix.patch

File 53635-06-improve-auto_detect_line_endings-fix.patch, 1.3 KB (added by jrf, 5 months ago)

Pomo/ PHP 8.1: improve the fix for auto_detect_line_endings ... as per the inline comment.

  • src/wp-includes/pomo/po.php

    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' ) ) { 
    1313        define( 'PO_MAX_LINE_LEN', 79 );
    1414}
    1515
    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 );
    2025
    2126/**
    2227 * Routines for working with PO files