CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Escapes queries. More...
Public Member Functions | |
__construct ( $language, $allowLeadingWildcard=true) | |
escapeQuotes ( $text) | |
fixupQueryStringPart ( $string) | |
Make sure the query string part is well formed by escaping some syntax that we don't want users to get direct access to and making sure quotes are balanced. | |
balanceQuotes ( $text) | |
unbalancedQuotes ( $text, $from=0, $to=-1) | |
unescape ( $query, $escapeChar='\\') | |
Unescape a given string. | |
getAllowLeadingWildcard () | |
Is leading wildcard allowed? | |
getLanguage () | |
Escapes queries.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
CirrusSearch\Search\Escaper::__construct | ( | $language, | |
$allowLeadingWildcard = true ) |
string | $language | MediaWiki language code |
bool | $allowLeadingWildcard |
CirrusSearch\Search\Escaper::balanceQuotes | ( | $text | ) |
string | $text |
CirrusSearch\Search\Escaper::escapeQuotes | ( | $text | ) |
string | $text |
CirrusSearch\Search\Escaper::fixupQueryStringPart | ( | $string | ) |
Make sure the query string part is well formed by escaping some syntax that we don't want users to get direct access to and making sure quotes are balanced.
These special characters aren't escaped:
string | $string |
CirrusSearch\Search\Escaper::getAllowLeadingWildcard | ( | ) |
Is leading wildcard allowed?
CirrusSearch\Search\Escaper::getLanguage | ( | ) |
CirrusSearch\Search\Escaper::unbalancedQuotes | ( | $text, | |
$from = 0, | |||
$to = -1 ) |
string | $text | |
int | $from | |
int | $to |
CirrusSearch\Search\Escaper::unescape | ( | $query, | |
$escapeChar = '\\' ) |
Unescape a given string.
string | $query | string to unescape |
string | $escapeChar | escape sequence |