File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,12 @@ public function _start(): void
521521 if ($ this ->requestHandled === false ) {
522522 // not doing much here, just setting the requestHandled flag to true
523523 $ this ->requestHandled = true ;
524+
525+ // Allow filters to run
526+ // This prevents multiple after events from being registered
527+ $ this ->after ('start ' , function () use ($ self ) {
528+ $ self ->stop ();
529+ });
524530 } else {
525531 // deregister the request and response objects and re-register them with new instances
526532 $ this ->unregister ('request ' );
@@ -535,11 +541,6 @@ public function _start(): void
535541 $ response = $ this ->response ();
536542 $ router = $ this ->router ();
537543
538- // Allow filters to run
539- $ this ->after ('start ' , function () use ($ self ) {
540- $ self ->stop ();
541- });
542-
543544 if ($ response ->v2_output_buffering === true ) {
544545 // Flush any existing output
545546 if (ob_get_length () > 0 ) {
You can’t perform that action at this time.
0 commit comments