mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
fix: correct escaping of ui flags for plausible (#3907)
## About the changes Stringified JSON still needs to be escaped before being placed in an HTML attribute.
This commit is contained in:
parent
82d855ea1f
commit
6f15eb9f4c
@ -20,7 +20,7 @@ export const PlausibleProvider: FC = ({ children }) => {
|
|||||||
'meta[name="uiFlags"]'
|
'meta[name="uiFlags"]'
|
||||||
) as HTMLMetaElement
|
) as HTMLMetaElement
|
||||||
)?.content || '{}';
|
)?.content || '{}';
|
||||||
return JSON.parse(uiFlagsStr);
|
return JSON.parse(decodeURI(uiFlagsStr));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export async function loadIndexHTML(
|
|||||||
publicFolder: string,
|
publicFolder: string,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const { cdnPrefix, baseUriPath = '' } = config.server;
|
const { cdnPrefix, baseUriPath = '' } = config.server;
|
||||||
const uiFlags = JSON.stringify(config.ui.flags);
|
const uiFlags = encodeURI(JSON.stringify(config.ui.flags || '{}'));
|
||||||
|
|
||||||
let indexHTML: string;
|
let indexHTML: string;
|
||||||
if (cdnPrefix) {
|
if (cdnPrefix) {
|
||||||
|
Loading…
Reference in New Issue
Block a user