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

V1.3.x (Retrofit Security Patch...) #1514

Closed
wants to merge 3 commits into from
Closed
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
8 changes: 5 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = function(grunt) {
uglify: {
options: {
mangle: true,
compress: true,
compress: {},
preserveComments: 'some'
},
dist: {
Expand Down Expand Up @@ -169,10 +169,12 @@ module.exports = function(grunt) {

// Build a new version of the library
this.registerTask('build', "Builds a distributable version of the current project", [
'clean',
'jshint',
'parser',
'node',
'globals',
'jshint']);
'globals'
]);

this.registerTask('amd', ['packager:amd', 'requirejs']);
this.registerTask('node', ['packager:cjs']);
Expand Down
4 changes: 4 additions & 0 deletions lib/handlebars/compiler/javascript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ JavaScriptCompiler.prototype = {
// PUBLIC API: You can override these methods in a subclass to provide
// alternative compiled forms for name lookup and buffering semantics
nameLookup: function(parent, name /* , type*/) {
if (name === 'constructor') {
return ['(', parent, '.propertyIsEnumerable(\'constructor\') ? ', parent, '.constructor : undefined', ')'];
}

var wrap,
ret;
if (parent.indexOf('depth') === 0) {
Expand Down
7 changes: 4 additions & 3 deletions lib/handlebars/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ var escape = {
">": ">",
'"': """,
"'": "'",
"`": "`"
"`": "`",
'=': '='
};

var badChars = /[&<>"'`]/g;
var possible = /[&<>"'`]/;
var badChars = /[&<>"'`=]/g;
var possible = /[&<>"'`=]/;

function escapeChar(chr) {
return escape[chr] || "&amp;";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "handlebars",
"barename": "handlebars",
"version": "1.3.0",
"version": "1.3.0-security-patch-1",
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
"homepage": "http://www.handlebarsjs.com/",
"keywords": [
Expand Down