File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -160,13 +160,16 @@ public function getRealPath(): string
160160 */
161161 public function getDirPath (): string
162162 {
163+
163164 if (is_null ($ this ->dirPath )) {
164165 $ root = (isset ($ _SERVER ['DOCUMENT_ROOT ' ])) ? $ _SERVER ['DOCUMENT_ROOT ' ] : "" ;
165166 $ root = htmlspecialchars ($ root , ENT_QUOTES , 'UTF-8 ' );
166167 $ this ->dirPath = str_replace ($ root , "" , $ this ->request ->getUri ()->getDir ());
167168
168- if (is_string ($ this ->dirPath ) && $ root .$ this ->dirPath !== $ _ENV ['APP_DIR ' ]) {
169- throw new \Exception ("Could not validate the dirPath " , 1 );
169+ if (isset ($ _ENV ['APP_DIR ' ])) {
170+ if (is_string ($ this ->dirPath ) && $ root .$ this ->dirPath !== $ _ENV ['APP_DIR ' ]) {
171+ throw new \Exception ("Could not validate the dirPath " , 1 );
172+ }
170173 }
171174 }
172175 if (!is_string ($ this ->dirPath )) {
You can’t perform that action at this time.
0 commit comments