[wp-trac] [WordPress Trac] #10041: like_escape() should escape backslashes too

WordPress Trac noreply at wordpress.org
Tue Jun 10 22:04:29 UTC 2014


#10041: like_escape() should escape backslashes too
---------------------------------+-----------------------------
 Reporter:  miau_jp              |       Owner:  wonderboymusic
     Type:  defect (bug)         |      Status:  reopened
 Priority:  high                 |   Milestone:  4.0
Component:  Formatting           |     Version:  2.8
 Severity:  normal               |  Resolution:
 Keywords:  4.0-early has-patch  |     Focuses:
---------------------------------+-----------------------------

Comment (by miqrogroove):

 Replying to [comment:61 johnjamesjacoby]:
 > Consider also that using `like_escape()` did not previously require a
 touch to the `$wpdb` global that's now required using the new
 `$wpdb->esc_like()` method. Is there any objection to a general
 `esc_like_sql()` function that does the global touch for us, and making
 `like_escape()` a wrapper for it?

 Using esc_like() without a database is a rare situation that would not be
 encountered by novice programmers.  There's nothing wrong with adding
 another function, but it's unnecessary.

 Regarding deprecation: Seems like a lot of fuss over a one-line function.
 It won't be used in core anymore, and however that's signaled is great.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/10041#comment:63>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list