WordPress.org

Make WordPress Core

#22420 closed defect (bug) (fixed)

Bookmarks/links Illegal string offset.

Reported by: pross Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

Warning: Illegal string offset 'categorize' in /home/pross/public_html/wp-includes/bookmark-template.php on line 213

Added quick patch.

Attachments (1)

patch.patch (738 bytes) - added by pross 17 months ago.

Download all attachments as: .zip

Change History (7)

pross17 months ago

comment:1 SergeyBiryukov17 months ago

  • Milestone changed from Awaiting Review to 3.5

Introduced in [22426].

comment:2 bpetty17 months ago

Ah, yes, this is correct. We only tested with the default theme which never calls wp_list_bookmarks() with no arguments. This means $args was always an array instead of the default empty string.

This would happen though if wp_list_bookmarks() was called from other themes without any arguments.

comment:3 follow-up: bpetty17 months ago

I wonder if it would be better to change the $args parameter default to array() instead. Is there a policy against using non-scalar default arguments?

comment:4 in reply to: ↑ 3 nacin17 months ago

Replying to bpetty:

I wonder if it would be better to change the $args parameter default to array() instead. Is there a policy against using non-scalar default arguments?

Nope. But I'm fine with patch.patch as it prevents further issues, like a plugin passing a scalar value in.

comment:5 SergeyBiryukov17 months ago

  • Keywords has-patch commit added

comment:6 nacin17 months ago

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

In 22565:

Avoid notices with [22426]. props pross. fixes #22420.

Note: See TracTickets for help on using tickets.