Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 4 years ago

#8018 closed defect (bug) (fixed)

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

Reported by: venutius's profile 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 (2)

#1 @boonebgorges
6 years 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.

#2 @imath
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

No news for 2 years, I'll close this ticket. Don't hesitate to reopen it if you think the issue is still there. Moreover as $query_params is a WP_REST_Request it should have disappeared.

Note: See TracTickets for help on using tickets.