File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/Symfony/Component/Runtime Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ public function __construct(array $options = [])
9393 $ envKey = $ options ['env_var_name ' ] ??= 'APP_ENV ' ;
9494 $ debugKey = $ options ['debug_var_name ' ] ??= 'APP_DEBUG ' ;
9595
96+ if (isset ($ _SERVER ['argv ' ]) && !empty ($ _GET )) {
97+ // register_argc_argv=On is too risky in web servers
98+ $ _SERVER ['argv ' ] = [];
99+ $ _SERVER ['argc ' ] = 0 ;
100+ }
101+
96102 if (isset ($ options ['env ' ])) {
97103 $ _SERVER [$ envKey ] = $ options ['env ' ];
98104 } elseif (empty ($ _GET ) && isset ($ _SERVER ['argv ' ]) && class_exists (ArgvInput::class)) {
@@ -203,10 +209,6 @@ protected static function register(GenericRuntime $runtime): GenericRuntime
203209
204210 private function getInput (): ArgvInput
205211 {
206- if (!empty ($ _GET ) && filter_var (ini_get ('register_argc_argv ' ), \FILTER_VALIDATE_BOOL )) {
207- throw new \Exception ('CLI applications cannot be run safely on non-CLI SAPIs with register_argc_argv=On. ' );
208- }
209-
210212 if (isset ($ this ->input )) {
211213 return $ this ->input ;
212214 }
You can’t perform that action at this time.
0 commit comments