Skip to:
Content

BuddyPress.org

Opened 3 months ago

Closed 3 months ago

#8288 closed defect (bug) (fixed)

PHP 7.4 Notice: Trying to access array offset...

Reported by: mercime Owned by: r-a-y
Milestone: 6.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch commit
Cc:

Description

Member pages and Group pages:
PHP Notice: Trying to access array offset on value of type int in https://example.com/wp-includes/formatting.php on line 904

  • on WP trunk and BP trunk

Attachments (1)

8288.01.patch (4.2 KB) - added by r-a-y 3 months ago.

Download all attachments as: .zip

Change History (7)

#1 @r-a-y
3 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.0.0

Seems to be caused by WP 5.4.1 due to the seems_utf8() check used in sanitize_file_name(): https://github.com/WordPress/WordPress/commit/cdd7f88252487e243734d9bfd61477bf2d1f64f1

seems_utf8() throws this notice when an integer value is passed and we do so in a few spots.

Attached patch fixes this by removing sanitize_file_name() when we're passing integer values.

Last edited 3 months ago by r-a-y (previous) (diff)

@r-a-y
3 months ago

#3 @imath
3 months ago

  • Keywords commit added

Thanks a lot for your patch @r-a-y : looks good to me 👌

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


3 months ago

#5 @mercime
3 months ago

Thank you @r-a-y, two thumbs up!

#6 @r-a-y
3 months ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 12647:

Do not use sanitize_file_name() when passing integer values.

Fixes an array offset notice due to the addition of seems_utf8() in
sanitize_file_name() for WordPress 5.4.1:
https://core.trac.wordpress.org/changeset/47643

Props mercime, r-a-y.

Fixes #8288.

Note: See TracTickets for help on using tickets.