Skip to:

Opened 9 years ago

Closed 9 years ago

#6369 closed regression (fixed)

_bp_strip_spans_from_title() causing fatal errors in 2.2.2

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile djpaul
Milestone: Priority: omg pizza
Severity: blocker Version: 2.2.2
Component: Core Keywords:


r9732 (#6107) introduced this fatal error:

Fatal error: Cannot redeclare _bp_strip_spans_from_title() (previously declared in /wp-content/plugins/buddypress/bp-core/bp-core-filters.php:552) in /wp-content/plugins/buddypress/bp-core/bp-core-filters.php on line 552

This is because _bp_strip_spans_from_title is nested inside bp_modify_page_title. If a site calls any of WP's title functions more than once (for example, wp_title or get_the_title), it triggers the fatal error. You can reproduce this easily by adding <?php wp_title(); ?> into the bottom of the active theme's footer.php, for example.

Thanks to @danbp for raising awareness in Slack, via @imath. First reported on the forums:

Relevant Slack logs of the investigation/discussion are at

Attachments (1)

6369.01.patch (1.5 KB) - added by DJPaul 9 years ago.

Download all attachments as: .zip

Change History (3)

#1 @DJPaul
9 years ago

From limited investigation of one of the reported sites that have this problem, I was unable to find a plugin that was triggering this problem, but imath and I are pretty sure that we have identified the root cause, even if we can't point to some theme/plugin/widget that demonstrates the problem.

9 years ago

#2 @djpaul
9 years ago

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

In 9741:

Core: move _bp_strip_spans_from_title() out of bp_modify_page_title().

The nested function was causing PHP Fatal Errors ("cannot redeclare") when WP's title functions were invoked more than once on the same screen.
This was introduced in r9732.

Fixes #6369

Note: See TracTickets for help on using tickets.