Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#5158 closed defect (bug) (fixed)

strstr() [function.strstr]: Empty delimiter in bp_is_current_component () when $component is empty

Reported by: megainfo Owned by: boonebgorges
Milestone: 1.9 Priority: normal
Severity: minor Version: 1.8.1
Component: Core Keywords: has-patch
Cc:

Description

A php warning strstr() [function.strstr]: Empty delimiter
line 864 caused by strstr call when $componentis empty string or null value.

Attachments (3)

bp-core-template.php.2.patch (4.7 KB) - added by megainfo 7 years ago.
second patch
bp-core-template.php.patch (539 bytes) - added by megainfo 7 years ago.
second patch
bp-core-template.php2.patch (4.7 KB) - added by megainfo 7 years ago.
first patch

Download all attachments as: .zip

Change History (9)

#1 @boonebgorges
7 years ago

  • Milestone changed from Awaiting Review to 1.9

#2 @boonebgorges
7 years ago

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

In 7361:

Ensure $component has been passed before checking is_current_component()

Passing an empty value was causing a PHP warning to be thrown when using
strstr() later in the function.

Fixes #5158

Props megainfo

#3 @megainfo
7 years ago

The warning appear in the eleseif condition ( when calling strstr() )

here a second patch (named bp-core-template.php.patch).

Last edited 7 years ago by megainfo (previous) (diff)

@megainfo
7 years ago

second patch

@megainfo
7 years ago

second patch

@megainfo
7 years ago

first patch

#4 @megainfo
7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#5 @boonebgorges
7 years ago

In 7366:

Always return false when null value is passed to bp_is_current_component()

This is an improvement on r7361, where only one condition of the component
check was checked against empty values of $component.

See #5158

Props megainfo

#6 @boonebgorges
7 years ago

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

Thanks.

Note: See TracTickets for help on using tickets.