#25151 closed defect (bug) (fixed)
comment_form() function treats $args as array before passing $args through wp_parse_args()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.6.1 | Priority: | normal |
| Severity: | normal | Version: | 3.6 |
| Component: | Comments | Keywords: | has-patch |
| Focuses: | Cc: |
Description
To reproduce simply call comment_form('fields=author'); with WP_DEBUG switched on. It will result in the following errors:
PHP Warning: Illegal string offset 'format' in /path/to/wordpress/wp-includes/comment-template.php on line 1610
PHP Warning: Illegal string offset 'format' in /path/to/wordpress/wp-includes/comment-template.php on line 1614
This appears to be a bug introduced in 3.6.
Attachments (1)
Change History (9)
#3
@
12 years ago
- Keywords has-patch added
The simplest solution is probably to call wp_parse_args() twice.
#4
follow-up:
↓ 5
@
12 years ago
If current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml' is added to the $defaults array for 'format', would that work? Then these lines could be removed.
#5
in reply to:
↑ 4
@
12 years ago
Replying to nacin:
If
current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml'is added to the$defaultsarray for'format', would that work? Then these lines could be removed.
No, we use it to set $fields, which is a part of $defaults array itself: tags/3.6/wp-includes/comment-template.php#L1614.
#6
@
12 years ago
I think 25151.patch is probably good, then.
Introduced in [24417].