Skip to:
Content

BuddyPress.org

Changeset 13509


Ignore:
Timestamp:
07/01/2023 11:39:15 AM (12 months ago)
Author:
imath
Message:

Prevent a PHP 8.1 deprecation notice in BP_Media_Extractor class

In BP_Media_Extractor::extract_audio() make sure $path is a string.

Props thomaslhotta

Fixes #8921 (branch 11.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/11.0/src/bp-core/classes/class-bp-media-extractor.php

    r12602 r13509  
    643643
    644644            foreach ( $links['links'] as $link ) {
    645                 $path = untrailingslashit( parse_url( $link['url'], PHP_URL_PATH ) );
     645                $path = (string) wp_parse_url( $link['url'], PHP_URL_PATH );
    646646
    647647                // Check this URL's file extension matches that of an accepted audio format.
    648                 if ( ! $path || substr( $path, -4 ) !== $extension ) {
     648                if ( ! $path || substr( untrailingslashit( $path ), -4 ) !== $extension ) {
    649649                    continue;
    650650                }
Note: See TracChangeset for help on using the changeset viewer.