Skip to content

Commit

Permalink
<amp-pinterest> Sanitize URLs (#13885)
Browse files Browse the repository at this point in the history
* Encode all UR components to sanitize them

* Assert that all URLs are http or https
  • Loading branch information
nainar authored and jridgewell committed Mar 8, 2018
1 parent 652a6b7 commit deb5a66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/amp-pinterest/0.1/pin-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import {Services} from '../../../src/services';
import {Util} from './util';
import {assertHttpsUrl} from '../../../src/url';
import {assertAbsoluteHttpOrHttpsUrl, assertHttpsUrl} from '../../../src/url';
import {openWindowDialog} from '../../../src/dom';
import {toWin} from '../../../src/types';

Expand Down Expand Up @@ -57,6 +57,7 @@ export class PinWidget {
const href = el.getAttribute('data-pin-href');
const log = el.getAttribute('data-pin-log');
if (href) {
assertAbsoluteHttpOrHttpsUrl(href);
if (shouldPop) {
openWindowDialog(window, href, '_pinit', POP);
} else {
Expand Down

0 comments on commit deb5a66

Please sign in to comment.