Make WordPress Core

Ticket #47751: 47751-External-PemFTP.patch

File 47751-External-PemFTP.patch, 1.0 KB (added by jrf, 5 years ago)

[External PemFTP] PHP 7.4 compatibility: fix deprecated curly brace array access

  • src/wp-admin/includes/class-ftp.php

    From dbc3b449ebca23798b2d19781a26d46e5d2c8fab Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 22 Jul 2019 05:13:03 +0200
    Subject: [PATCH] [External PemFTP] PHP 7.4 compatibility: fix deprecated curly
     brace array access
    
    PHP 7.4 will deprecated array access using curly braces.
    
    Ref: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
    ---
     src/wp-admin/includes/class-ftp.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-admin/includes/class-ftp.php b/src/wp-admin/includes/class-ftp.php
    index 60fb2a19f6..3bfa469d20 100644
    a b class ftp_base { 
    185185                        $lcount=count($lucifer);
    186186                        if ($lcount<8) return '';
    187187                        $b = array();
    188                         $b['isdir'] = $lucifer[0]{0} === "d";
    189                         $b['islink'] = $lucifer[0]{0} === "l";
     188                        $b['isdir'] = $lucifer[0][0] === "d";
     189                        $b['islink'] = $lucifer[0][0] === "l";
    190190                        if ( $b['isdir'] )
    191191                                $b['type'] = 'd';
    192192                        elseif ( $b['islink'] )