Skip to:
Content

BuddyPress.org

Opened 21 months ago

Last modified 21 months ago

#8018 new defect (bug)

Undefine Index Error in class-bp-core-oembed-extension.php

Reported by: Venutius Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0.0
Component: Media Keywords:
Cc:

Description

I get the following error message very occasionally:

[03-Dec-2018 06:23:16 UTC] PHP Notice: Undefined index: url in /wp-content/plugins/buddypress/bp-core/classes/class-bp-core-oembed-extension.php on line 483

Looking at the code, it seems to be checking for validity of the url:

!#python
if ( false === $this->validate_url_to_item_id( $query_params['url'] ) ) {
	return $served;
}

Maybe this could be changed to:

!#python
if ( ! isset( $query_params['url'] ) || false === $this->validate_url_to_item_id( $query_params['url'] ) ) {
	return $served;
}

Change History (1)

#1 @boonebgorges
21 months ago

Thanks for the ticket, @Venutius.

Is it a bug that $query_params['url'] would sometimes be empty? If so, I don't want to paper over it with an isset() check. Maybe @djpaul can chime in.

Note: See TracTickets for help on using tickets.