safer decodeURIComponent(), fixes #277
This commit is contained in:
parent
2a5b59002e
commit
df911c9e97
@ -504,7 +504,10 @@ export const ReportMediaContent = ({ source }) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadName = decodeURIComponent(get(record, "event_json.content.body")?.toString());
|
let uploadName = "";
|
||||||
|
if (get(record, "event_json.content.body")) {
|
||||||
|
uploadName = decodeURIComponent(get(record, "event_json.content.body")?.toString());
|
||||||
|
}
|
||||||
|
|
||||||
return <ViewMediaButton mxcURL={mxcURL} label={mxcURL} uploadName={uploadName} mimetype={record.media_type}/>;
|
return <ViewMediaButton mxcURL={mxcURL} label={mxcURL} uploadName={uploadName} mimetype={record.media_type}/>;
|
||||||
};
|
};
|
||||||
|
@ -505,7 +505,7 @@ export const UserEdit = (props: EditProps) => {
|
|||||||
<DateField source="last_access_ts" showTime options={DATE_FORMAT} />
|
<DateField source="last_access_ts" showTime options={DATE_FORMAT} />
|
||||||
<NumberField source="media_length" />
|
<NumberField source="media_length" />
|
||||||
<TextField source="media_type" sx={{ display: "block", width: 200, wordBreak: "break-word" }} />
|
<TextField source="media_type" sx={{ display: "block", width: 200, wordBreak: "break-word" }} />
|
||||||
<FunctionField source="upload_name" render={record => decodeURIComponent(record.upload_name)} />
|
<FunctionField source="upload_name" render={record => record.upload_name ? decodeURIComponent(record.upload_name) : ""} />
|
||||||
<TextField source="quarantined_by" />
|
<TextField source="quarantined_by" />
|
||||||
<QuarantineMediaButton label="resources.quarantine_media.action.name" />
|
<QuarantineMediaButton label="resources.quarantine_media.action.name" />
|
||||||
<ProtectMediaButton label="resources.users_media.fields.safe_from_quarantine" />
|
<ProtectMediaButton label="resources.users_media.fields.safe_from_quarantine" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user