mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-12-02 13:32:43 -05:00
Fix [GHSA-wpf6-5v7v-6cvj](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-wpf6-5v7v-6cvj) Introduced in https://github.com/FreshRSS/FreshRSS/pull/7668
25 lines
913 B
PHP
25 lines
913 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use PHPUnit\Framework\Attributes\PreserveGlobalState;
|
|
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
|
|
|
|
#[RunTestsInSeparateProcesses]
|
|
#[PreserveGlobalState(false)]
|
|
final class indexControllerTest extends \PHPUnit\Framework\TestCase {
|
|
|
|
public function testUnknownViewModeIsEncodedInNotification(): void {
|
|
FreshRSS_Context::initSystem();
|
|
FreshRSS_Context::setUserConf(clone FreshRSS_UserConfiguration::default());
|
|
FreshRSS_Context::userConf()->view_mode = '<form action="https://example.net/">';
|
|
Minz_Translate::init('en');
|
|
|
|
(new FreshRSS_index_Controller())->indexAction();
|
|
|
|
$notification = Minz_Request::getNotification();
|
|
self::assertNotNull($notification);
|
|
self::assertStringContainsString('<form action="https://example.net/">', $notification['content']);
|
|
self::assertStringNotContainsString('<', $notification['content']);
|
|
}
|
|
}
|