WordPress.org

Make WordPress Core

Ticket #47704: 47704-wpdb-strip_invalid_text.patch

File 47704-wpdb-strip_invalid_text.patch, 960 bytes (added by jrf, 12 months ago)

PHP 7.4/array-access: Fix wpdb::strip_invalid_text() - fixes 3 errors

  • src/wp-includes/wp-db.php

    From 871a0b3a87c05f3a11e93765e778f5dd4980aa9b Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 15 Jul 2019 03:00:16 +0200
    Subject: [PATCH] PHP 7.4/array-access: Fix wpdb::strip_invalid_text()
    
    ---
     src/wp-includes/wp-db.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php
    index 46851b14fb..559e3b6d2c 100644
    a b class wpdb { 
    30713071                        foreach ( $data as $col => $value ) {
    30723072                                if ( ! empty( $value['db'] ) ) {
    30733073                                        // We're going to need to truncate by characters or bytes, depending on the length value we have.
    3074                                         if ( 'byte' === $value['length']['type'] ) {
     3074                                        if ( isset( $value['length']['type'] ) && 'byte' === $value['length']['type'] ) {
    30753075                                                // Using binary causes LEFT() to truncate by bytes.
    30763076                                                $charset = 'binary';
    30773077                                        } else {