mirror of https://notabug.org/acetone/ircabot.git
search case insensetive
parent
22c69e3c37
commit
383311e9db
|
@ -362,7 +362,7 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
QString searchRequest = global::getValue(urlPath, "toSearch", global::eForWeb);
|
QString searchRequest = global::getValue(urlPath, "toSearch", global::eForWeb);
|
||||||
// Search request
|
// Search request
|
||||||
if (not searchRequest.isEmpty()) {
|
if (not searchRequest.isEmpty()) {
|
||||||
QRegularExpression userRgx(searchRequest);
|
QRegularExpression userRgx(searchRequest, QRegularExpression::CaseInsensitiveOption);
|
||||||
bool rgxIsValid = false;
|
bool rgxIsValid = false;
|
||||||
if (userRgx.isValid()) rgxIsValid = true;
|
if (userRgx.isValid()) rgxIsValid = true;
|
||||||
consoleLog("Search request (" + server + "): " + searchRequest);
|
consoleLog("Search request (" + server + "): " + searchRequest);
|
||||||
|
@ -433,7 +433,7 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
QString buffer {file.readAll()};
|
QString buffer {file.readAll()};
|
||||||
file.close();
|
file.close();
|
||||||
if (rgxIsValid) {
|
if (rgxIsValid) {
|
||||||
if (QRegularExpression(searchRequest).match(buffer).hasMatch()) {
|
if (QRegularExpression(searchRequest, QRegularExpression::CaseInsensitiveOption).match(buffer).hasMatch()) {
|
||||||
matchedPaths.push_back(path);
|
matchedPaths.push_back(path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -465,7 +465,7 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
QString buffer {file.readAll()};
|
QString buffer {file.readAll()};
|
||||||
file.close();
|
file.close();
|
||||||
if (rgxIsValid) {
|
if (rgxIsValid) {
|
||||||
if (QRegularExpression(searchRequest).match(buffer).hasMatch()) {
|
if (QRegularExpression(searchRequest, QRegularExpression::CaseInsensitiveOption).match(buffer).hasMatch()) {
|
||||||
matchedPaths.push_back(path);
|
matchedPaths.push_back(path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -520,7 +520,7 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
QString buffer {file.readAll()};
|
QString buffer {file.readAll()};
|
||||||
file.close();
|
file.close();
|
||||||
if (rgxIsValid) {
|
if (rgxIsValid) {
|
||||||
if (QRegularExpression(searchRequest).match(buffer).hasMatch()) {
|
if (QRegularExpression(searchRequest, QRegularExpression::CaseInsensitiveOption).match(buffer).hasMatch()) {
|
||||||
matchedPaths.push_back(path);
|
matchedPaths.push_back(path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue