Ticket #10041: 10041.3.diff

File 10041.3.diff, 1.2 KB (added by Denis-de-Bernardy, 3 years ago)
Line 
1Index: wp-includes/taxonomy.php
2===================================================================
3--- wp-includes/taxonomy.php    (revision 13499)
4+++ wp-includes/taxonomy.php    (working copy)
5@@ -866,7 +866,7 @@
6        }
7 
8        if ( !empty($search) ) {
9-               $search = like_escape($search);
10+               $search = like_escape(stripslashes($search));
11                $where .= " AND (t.name LIKE '%$search%')";
12        }
13 
14Index: wp-includes/bookmark.php
15===================================================================
16--- wp-includes/bookmark.php    (revision 13499)
17+++ wp-includes/bookmark.php    (working copy)
18@@ -181,7 +181,7 @@
19        }
20 
21        if ( ! empty($search) ) {
22-               $search = like_escape($search);
23+               $search = like_escape(stripslashes($search));
24                $search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) ";
25        }
26 
27Index: wp-includes/formatting.php
28===================================================================
29--- wp-includes/formatting.php  (revision 13499)
30+++ wp-includes/formatting.php  (working copy)
31@@ -2329,7 +2329,7 @@
32  * @return string text, safe for inclusion in LIKE query.
33  */
34 function like_escape($text) {
35-       return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
36+       return esc_sql(addcslashes($text, '_%\\'));
37 }
38 
39 /**