Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37744 closed defect (bug) (fixed)

wpdb::prepare PHPDoc recommends bad PHP

Reported by: tjnowell's profile TJNowell Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.3
Component: Database Keywords: has-patch
Focuses: docs Cc:

Description

The phpdoc of the prepare method recommends calling it statically via the examples. Doing this would cause PHP warnings and notices.

I've attached a diff that should correct this by changing wpdb::prepare to $wpdb->prepare

Attachments (1)

wpdb.diff (740 bytes) - added by TJNowell 8 years ago.
A diff to be applied to wp-db.php that adjusts the phpdocs of wpdb::prepare

Download all attachments as: .zip

Change History (4)

@TJNowell
8 years ago

A diff to be applied to wp-db.php that adjusts the phpdocs of wpdb::prepare

#1 @pento
8 years ago

  • Milestone changed from Awaiting Review to 4.7

Good catch, thanks @TJNowell!

#2 @Presskopp
8 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
8 years ago

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

In 38289:

Docs: Correct usage examples for wpdb::prepare(), which should not be called statically.

Props TJNowell.
Fixes #37744.

Note: See TracTickets for help on using tickets.