Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<base href and <embed src data: need to be escaped #10695

Merged
merged 2 commits into from
Mar 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2",
"htmlbars": "0.11.1",
"htmlbars": "0.11.2",
"qunit-extras": "^1.3.0",
"qunitjs": "^1.16.0",
"route-recognizer": "0.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-htmlbars/lib/hooks/attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import AttrNode from "ember-views/attr_nodes/attr_node";
import EmberError from "ember-metal/error";
import { isStream } from "ember-metal/streams/utils";
import sanitizeAttributeValue from "ember-views/system/sanitize_attribute_value";
import sanitizeAttributeValue from "morph-attr/sanitize-attribute-value";

var boundAttributesEnabled = false;

Expand Down
15 changes: 15 additions & 0 deletions packages/ember-htmlbars/tests/attr_nodes/sanitized_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,39 @@ QUnit.module("ember-htmlbars: sanitized attribute", {

if (Ember.FEATURES.isEnabled('ember-htmlbars-attribute-syntax')) {
// jscs:disable validateIndentation
// jscs:disable disallowTrailingWhitespace

var badTags = [
{ tag: 'a', attr: 'href',
unquotedTemplate: compile("<a href={{url}}></a>"),
quotedTemplate: compile("<a href='{{url}}'></a>"),
multipartTemplate: compile("<a href='{{protocol}}{{path}}'></a>") },

{ tag: 'base', attr: 'href',
unquotedTemplate: compile("<base href={{url}} />"),
quotedTemplate: compile("<base href='{{url}}'/>"),
multipartTemplate: compile("<base href='{{protocol}}{{path}}'/>") },

{ tag: 'embed', attr: 'src',
unquotedTemplate: compile("<embed src={{url}} />"),
quotedTemplate: compile("<embed src='{{url}}'/>"),
multipartTemplate: compile("<embed src='{{protocol}}{{path}}'/>") },

{ tag: 'body', attr: 'background',
unquotedTemplate: compile("<body background={{url}}></body>"),
quotedTemplate: compile("<body background='{{url}}'></body>"),
multipartTemplate: compile("<body background='{{protocol}}{{path}}'></body>") },

{ tag: 'link', attr: 'href',
unquotedTemplate: compile("<link href={{url}}>"),
quotedTemplate: compile("<link href='{{url}}'>"),
multipartTemplate: compile("<link href='{{protocol}}{{path}}'>") },

{ tag: 'img', attr: 'src',
unquotedTemplate: compile("<img src={{url}}>"),
quotedTemplate: compile("<img src='{{url}}'>"),
multipartTemplate: compile("<img src='{{protocol}}{{path}}'>") },

{ tag: 'iframe', attr: 'src',
// Setting an iframe with a bad protocol results in the browser
// being redirected. in IE8. Skip the iframe tests on that platform.
Expand Down
55 changes: 0 additions & 55 deletions packages/ember-views/lib/system/sanitize_attribute_value.js

This file was deleted.

56 changes: 0 additions & 56 deletions packages/ember-views/tests/system/sanitize_attribute_value_test.js

This file was deleted.