mirror of https://notabug.org/acetone/ircabot.git
bug fix for one named month and day (webUi)
parent
89f4174c39
commit
a07b95fe92
|
@ -228,11 +228,17 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
|||
month = getWordFromPath(urlPath);
|
||||
month.remove(QRegularExpression("\\?.*$"));
|
||||
if (not month.isEmpty() and fsPath.cd(month)) {
|
||||
urlPath.remove(QRegularExpression("^.*/"+month));
|
||||
day = getWordFromPath(urlPath);
|
||||
day.remove(QRegularExpression("\\?.*$"));
|
||||
if (not QFile::exists(fsPath.path()+global::slash+day+".txt")) {
|
||||
day.clear();
|
||||
if (urlPath.startsWith("/"+month+"/")) {
|
||||
urlPath.remove(0,1);
|
||||
int pos = urlPath.indexOf('/');
|
||||
if (pos != -1) {
|
||||
urlPath.remove(0,pos);
|
||||
day = getWordFromPath(urlPath);
|
||||
day.remove(QRegularExpression("\\?.*$"));
|
||||
if (not QFile::exists(fsPath.path()+global::slash+day+".txt")) {
|
||||
day.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { month.clear(); }
|
||||
|
@ -454,7 +460,7 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
|||
}
|
||||
|
||||
/* If you are reading this code, maybe you are crying now.
|
||||
* Sorry me, man (woman/forgot/etc). Maybe I'll refactor this hell in the future.
|
||||
* Sorry me, man (woman/fagot/etc). Maybe I'll refactor this hell in the future.
|
||||
* acetone.
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue