Fix PHP Warning: Cannot modify header information headers already sent (#9267)

Closes #9229

I restored my accidently deleted patches with @Inverle fixes. This fix is still works perfectly. Sorry. (https://github.com/FreshRSS/FreshRSS/pull/9230)

How to test the feature manually:

With this change:
1. Go to FreshRSS UserCSS extension config
2. Enable the UserCSS and set the CSS code in it.
3. Go to FreshRSS feeds page.
4. Hit the ctrl + F5 button and see no errors in the nginx log.
This commit is contained in:
András Marczinkó authored and GitHub committed 2026-09-06 21:32:48 +02:00
1 parent ce6e57ae0f
commit 99ee090236
2 files changed
+6 -1

No files matched your search

+2 -1
View File
@@ -362,7 +362,8 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController {
header("Content-Disposition: inline; filename='{$filename}'");
header('Referrer-Policy: same-origin');
if (file_exists(DATA_PATH . '/no-cache.txt') || !httpConditional($mtime, cacheSeconds: 604800, cachePrivacy: 2)) {
echo $extension->getFile($filename);
$contents = $extension->getFile($filename);
$this->view->content = is_string($contents) ? $contents : '';
}
}
}
+4
View File
@@ -0,0 +1,4 @@
<?php
declare(strict_types=1);
/** @var FreshRSS_View $this */
echo $this->content;