Long search request cant break page

master
const an teen 2022-01-04 11:35:49 -05:00
parent aaee3a7f9d
commit cfcf3a01b9
1 changed files with 8 additions and 1 deletions

View File

@ -1024,7 +1024,14 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
}
}
}
middlePath += " " + searchRequest + " ";
int lastWbr = 0;
for (int i = 0; i < searchRequest.size(); i++) {
if (i-lastWbr > MAX_MESSAGE_LENGTH_WITHOUT_WBR) {
searchRequest.insert(i, "<wbr>");
lastWbr = i;
}
}
middlePath += " <span style=\"color: #4f9c65\">" + searchRequest + "</span> ";
if (rgxIsValid) middlePath += "rgx";
middlePath += "(" + QString::number(counter) + ")";
}