Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#22420 closed defect (bug) (fixed)

Bookmarks/links Illegal string offset.

Reported by: pross's profile pross Owned by: nacin's profile 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 11 years ago.

Download all attachments as: .zip

Change History (7)

@pross
11 years ago

#1 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.5

Introduced in [22426].

#2 @bpetty
11 years 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.

#3 follow-up: @bpetty
11 years 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?

#4 in reply to: ↑ 3 @nacin
11 years 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.

#5 @SergeyBiryukov
11 years ago

  • Keywords has-patch commit added

#6 @nacin
11 years 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.