[wp-trac] [WordPress Trac] #25604: first argument of wpdb::prepare should have a placeholder
WordPress Trac
noreply at wordpress.org
Wed Oct 16 04:45:19 UTC 2013
#25604: first argument of wpdb::prepare should have a placeholder
------------------------------+------------------------------
Reporter: ounziw | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version:
Severity: normal | Resolution:
Keywords: |
------------------------------+------------------------------
Comment (by ounziw):
> {{{
> if ( strpos($query,'%') === false || strpos($query,'$')
!== false )
> _doing_it_wrong( 'wpdb::prepare', 'first argument
of wpdb::prepare() should have a preceholder.', '3.7' );
> }}}
it should be
{{{
if ( strpos($query,'%') === false && strpos($query,'$')
!== false )
_doing_it_wrong( 'wpdb::prepare', 'first argument
of wpdb::prepare() should have a preceholder.', '3.7' );
}}}
(If no %, it means no placeholder, and if there is $, it must be a
variable which should be escaped)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25604#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list