http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70159
Revision: 70159
Author: nikerabbit
Date: 2010-07-29 18:37:45 +0000 (Thu, 29 Jul 2010)
Log Message:
-----------
Mark escapeLike deprecated, since it is broken
Modified Paths:
--------------
trunk/phase3/includes/db/Database.php
Modified: trunk/phase3/includes/db/Database.php
===================================================================
--- trunk/phase3/includes/db/Database.php 2010-07-29 18:37:24 UTC (rev
70158)
+++ trunk/phase3/includes/db/Database.php 2010-07-29 18:37:45 UTC (rev
70159)
@@ -1507,8 +1507,14 @@
* Escape string for safe LIKE usage.
* WARNING: you should almost never use this function directly,
* instead use buildLike() that escapes everything automatically
+ * Deprecated in 1.17, warnings in 1.17, removed in ???
*/
- function escapeLike( $s ) {
+ public function escapeLike( $s ) {
+ wfDeprecated( __METHOD__ );
+ return $this->escapeLikeInternal( $s );
+ }
+
+ protected function escapeLikeInternal( $s ) {
$s = str_replace( '\\', '\\\\', $s );
$s = $this->strencode( $s );
$s = str_replace( array( '%', '_' ), array( '\%', '\_' ), $s );
@@ -1524,7 +1530,7 @@
* for subpages of 'My page title'.
* Alternatively: $pattern = array( 'My_page_title/', $dbr->anyString()
); $query .= $dbr->buildLike( $pattern );
*
- * @ return String: fully built LIKE statement
+ * @return String: fully built LIKE statement
*/
function buildLike() {
$params = func_get_args();
@@ -1537,7 +1543,7 @@
if( $value instanceof LikeMatch ) {
$s .= $value->toString();
} else {
- $s .= $this->escapeLike( $value );
+ $s .= $this->escapeLikeInternal( $value );
}
}
return " LIKE '" . $s . "' ";
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs