Making WordPress.org

Changeset 10602


Ignore:
Timestamp:
01/19/2021 11:07:16 PM (3 years ago)
Author:
dd32
Message:

Support: Fix a PHP warning caused when only one tag is added to a thread.

Amends [10599].
See #5344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-performance-optimizations.php

    r10599 r10602  
    499499
    500500        if ( ! empty( $topic['tax_input'][ $taxonomy ] ) ) {
     501            if ( ! is_array( $topic['tax_input'][ $taxonomy ] ) ) {
     502                $topic['tax_input'][ $taxonomy ] = preg_split( '/,\s+/', trim( $topic['tax_input'][ $taxonomy ], " \n\t\r\0\x0B," ) );
     503            }
     504
    501505            // Loop through the proposed terms
    502506            foreach ( $topic['tax_input'][ $taxonomy ] as $i => $term ) {
     
    527531
    528532        if ( ! is_array( $terms ) ) {
    529             $terms = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) );
     533            $terms = preg_split( '/,\s+/', trim( $terms, " \n\t\r\0\x0B," ) );
    530534        }
    531535
Note: See TracChangeset for help on using the changeset viewer.