Probably fixed URI path info

This commit is contained in:
2019-11-20 14:01:11 +01:00
parent e4bcbbf31c
commit 3e545895b2

View File

@ -63,7 +63,9 @@ URI::URI(string webroot, string reqpath) {
info = ""; info = "";
relpath = reqpath; relpath = reqpath;
while (!fileExists(webroot + relpath) && !fileExists(webroot + relpath + ".php") && !fileExists(webroot + relpath + ".html")) { while ((!fileExists(webroot + relpath) || (isDirectory(webroot + relpath) && !fileExists(webroot + relpath + "/index.php")))
&& (!fileExists(webroot + relpath + ".php") || (isDirectory(webroot + relpath + ".php") && !fileExists(webroot + relpath + ".php/index.php")))
&& (!fileExists(webroot + relpath + ".html") || (isDirectory(webroot + relpath + ".html") && !fileExists(webroot + relpath + ".html/index.php")))) {
long slash = relpath.find_last_of('/'); long slash = relpath.find_last_of('/');
if (slash == string::npos) { if (slash == string::npos) {
break; break;