Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1507,8 +1507,14 @@ |
1508 | 1508 | * Escape string for safe LIKE usage. |
1509 | 1509 | * WARNING: you should almost never use this function directly, |
1510 | 1510 | * instead use buildLike() that escapes everything automatically |
| 1511 | + * Deprecated in 1.17, warnings in 1.17, removed in ??? |
1511 | 1512 | */ |
1512 | | - function escapeLike( $s ) { |
| 1513 | + public function escapeLike( $s ) { |
| 1514 | + wfDeprecated( __METHOD__ ); |
| 1515 | + return $this->escapeLikeInternal( $s ); |
| 1516 | + } |
| 1517 | + |
| 1518 | + protected function escapeLikeInternal( $s ) { |
1513 | 1519 | $s = str_replace( '\\', '\\\\', $s ); |
1514 | 1520 | $s = $this->strencode( $s ); |
1515 | 1521 | $s = str_replace( array( '%', '_' ), array( '\%', '\_' ), $s ); |
— | — | @@ -1524,7 +1530,7 @@ |
1525 | 1531 | * for subpages of 'My page title'. |
1526 | 1532 | * Alternatively: $pattern = array( 'My_page_title/', $dbr->anyString() ); $query .= $dbr->buildLike( $pattern ); |
1527 | 1533 | * |
1528 | | - * @ return String: fully built LIKE statement |
| 1534 | + * @return String: fully built LIKE statement |
1529 | 1535 | */ |
1530 | 1536 | function buildLike() { |
1531 | 1537 | $params = func_get_args(); |
— | — | @@ -1537,7 +1543,7 @@ |
1538 | 1544 | if( $value instanceof LikeMatch ) { |
1539 | 1545 | $s .= $value->toString(); |
1540 | 1546 | } else { |
1541 | | - $s .= $this->escapeLike( $value ); |
| 1547 | + $s .= $this->escapeLikeInternal( $value ); |
1542 | 1548 | } |
1543 | 1549 | } |
1544 | 1550 | return " LIKE '" . $s . "' "; |