File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -561,14 +561,12 @@ protected function hasNativeHeaderConflict(): bool
561561
562562 // Native Header Inspection
563563 foreach (headers_list () as $ header ) {
564- // Content-Type is set but is NOT text/html
565- $ lowercaseHeader = strtolower ($ header );
564+ $ lowerHeader = strtolower ($ header );
566565
567- if (str_starts_with ($ lowercaseHeader , 'content-type: ' ) && ! str_contains ($ lowercaseHeader , 'text/html ' )) {
568- return true ;
569- }
570- // File is being downloaded (Attachment)
571- if (str_starts_with (strtolower ($ header ), strtolower ('Content-Disposition: ' )) && str_contains (strtolower ($ header ), strtolower ('attachment ' ))) {
566+ $ isNonHtmlContent = str_starts_with ($ lowerHeader , 'content-type: ' ) && ! str_contains ($ lowerHeader , 'text/html ' );
567+ $ isAttachment = str_starts_with ($ lowerHeader , 'content-disposition: ' ) && str_contains ($ lowerHeader , 'attachment ' );
568+
569+ if ($ isNonHtmlContent || $ isAttachment ) {
572570 return true ;
573571 }
574572 }
You can’t perform that action at this time.
0 commit comments