File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,15 +70,15 @@ class Request {
7070 * @return \Darya\Http\Request
7171 */
7272 public static function createFromGlobals (SessionInterface $ session = null ) {
73- $ uri = $ _SERVER ['REQUEST_URI ' ];
74- $ method = strtolower ($ _SERVER ['REQUEST_METHOD ' ]);
73+ $ uri = isset ( $ _SERVER ['REQUEST_URI ' ]) ? $ _SERVER [ ' REQUEST_URI ' ] : ' / ' ;
74+ $ method = isset ( $ _SERVER [ ' REQUEST_METHOD ' ]) ? strtolower ($ _SERVER ['REQUEST_METHOD ' ]) : ' get ' ;
7575
7676 $ request = new static ($ uri , $ method , array (
77- 'get ' => $ _GET ,
78- 'post ' => $ _POST ,
79- 'cookie ' => $ _COOKIE ,
80- 'file ' => $ _FILES ,
81- 'server ' => $ _SERVER ,
77+ 'get ' => $ _GET ?: array () ,
78+ 'post ' => $ _POST ?: array () ,
79+ 'cookie ' => $ _COOKIE ?: array () ,
80+ 'file ' => $ _FILES ?: array () ,
81+ 'server ' => $ _SERVER ?: array () ,
8282 'header ' => static ::headersFromGlobals ($ _SERVER )
8383 ));
8484
You can’t perform that action at this time.
0 commit comments