Redirect after saving user CSS/JS so changes apply immediately (#9006)

Saving custom CSS/JS rendered the response from the pre-save state (no
Post/Redirect/Get), so the stylesheet cache-busting URL was stale and
the change only appeared after a manual reload, which reads as erratic
behavior. Redirect back to the extension config after save, matching
the pattern used elsewhere in the codebase.

Fixes #8795

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
TowyTowy
2026-07-09 16:37:49 +02:00
committed by GitHub
parent 143cb09418
commit f7c4fbeeed
4 changed files with 12 additions and 2 deletions

View File

@@ -25,6 +25,11 @@ final class UserCSSExtension extends Minz_Extension {
$css_rules = Minz_Request::paramString('css-rules', plaintext: true);
$this->saveFile(self::FILENAME, $css_rules);
FreshRSS_UserDAO::touch();
// Redirect (Post/Redirect/Get) so the next page is built after the save,
// with a fresh cache-busting URL for the updated stylesheet
Minz_Request::good(_t('feedback.conf.updated'), [
'c' => 'extension', 'a' => 'configure', 'params' => ['e' => $this->getName()],
]);
}
$this->css_rules = '';