Commit 9abfbf18 by Torkel Ödegaard

Snapshots: Sanitize orignal url (#23254)


(cherry picked from commit fb114a75)
parent 882ed637
......@@ -17,6 +17,7 @@ import { DashboardModel } from '../../state';
import { CoreEvents, StoreState } from 'app/types';
import { ShareModal } from 'app/features/dashboard/components/ShareModal';
import { SaveDashboardModalProxy } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardModalProxy';
import { sanitizeUrl } from 'app/core/utils/text';
export interface OwnProps {
dashboard: DashboardModel;
......@@ -151,6 +152,7 @@ export class DashNav extends PureComponent<Props> {
const { canStar, canSave, canShare, showSettings, isStarred } = dashboard.meta;
const { snapshot } = dashboard;
const snapshotUrl = snapshot && snapshot.originalUrl;
return (
<div className="navbar">
{this.isInFullscreenOrSettings && this.renderBackButton()}
......@@ -239,7 +241,7 @@ export class DashNav extends PureComponent<Props> {
tooltip="Open original dashboard"
classSuffix="snapshot-origin"
icon="gicon gicon-link"
href={snapshotUrl}
href={sanitizeUrl(snapshotUrl)}
/>
)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment