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 = getWordFromPath(urlPath);
|
||||||
month.remove(QRegularExpression("\\?.*$"));
|
month.remove(QRegularExpression("\\?.*$"));
|
||||||
if (not month.isEmpty() and fsPath.cd(month)) {
|
if (not month.isEmpty() and fsPath.cd(month)) {
|
||||||
urlPath.remove(QRegularExpression("^.*/"+month));
|
if (urlPath.startsWith("/"+month+"/")) {
|
||||||
day = getWordFromPath(urlPath);
|
urlPath.remove(0,1);
|
||||||
day.remove(QRegularExpression("\\?.*$"));
|
int pos = urlPath.indexOf('/');
|
||||||
if (not QFile::exists(fsPath.path()+global::slash+day+".txt")) {
|
if (pos != -1) {
|
||||||
day.clear();
|
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(); }
|
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.
|
/* 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.
|
* acetone.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue