Преглед на файлове

Added check for if .project.ROOT is missing

If a installation is missing the .project.ROOT previously it would just use the last search path as the project root (wrong) this will cause a Exception should it be unable to find it
Mafoo преди 9 години
родител
ревизия
7a1348cfdb

+ 3 - 0
core/databases/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/default_settings/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/domain_settings/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/install/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/menu/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/upgrade/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/user_settings/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
core/users/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
resources/captcha/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
resources/classes/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
resources/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
themes/accessible/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
themes/enhanced/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}

+ 3 - 0
themes/minimized/root.php

@@ -74,6 +74,9 @@
 				}
 				}
 				$i++;
 				$i++;
 			}
 			}
+			if(!file_exists($path. '/.project.ROOT')){
+				throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
+			}
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
 			define('PROJECT_PATH', $project_path);
 			define('PROJECT_PATH', $project_path);
 		}
 		}