Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
denschub committed Dec 19, 2015
2 parents 2025fae + 9cb4b73 commit c238329
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

## Features

# 0.5.5.1

* Fix XSS on profile pages
* Bump nokogiri to fix several libxml2 CVEs, see http://www.ubuntu.com/usn/usn-2834-1/

# 0.5.5.0

## Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ gem "messagebus_ruby_api", "1.0.3"

# Parsing

gem "nokogiri", "1.6.6.4"
gem "nokogiri", "1.6.7.1"
gem "redcarpet", "3.3.3"
gem "twitter-text", "1.13.0"
gem "roxml", "3.1.6"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ GEM
method_source (0.8.2)
mime-types (2.6.2)
mini_magick (4.3.6)
mini_portile (0.6.2)
mini_portile2 (2.0.0)
minitest (5.8.2)
mobile-fu (1.3.1)
rack-mobile-detect
Expand All @@ -453,8 +453,8 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (3.0.1)
nio4r (1.1.1)
nokogiri (1.6.6.4)
mini_portile (~> 0.6.0)
nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
Expand Down Expand Up @@ -817,7 +817,7 @@ DEPENDENCIES
minitest
mobile-fu (= 1.3.1)
mysql2 (= 0.3.20)
nokogiri (= 1.6.6.4)
nokogiri (= 1.6.7.1)
omniauth (= 1.2.2)
omniauth-facebook (= 2.0.1)
omniauth-tumblr (= 1.1)
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/app/helpers/handlebars-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ Handlebars.registerHelper('linkToPerson', function(context, block) {
});

// relationship indicator for profile page
Handlebars.registerHelper('sharingMessage', function(person) {
var i18n_scope = 'people.helper.is_not_sharing';
Handlebars.registerHelper("sharingMessage", function(person) {
var i18nScope = "people.helper.is_not_sharing";
var icon = "circle";
if( person.is_sharing ) {
i18n_scope = 'people.helper.is_sharing';
i18nScope = "people.helper.is_sharing";
icon = "entypo check";
}

var title = Diaspora.I18n.t(i18n_scope, {name: person.name});
var title = Diaspora.I18n.t(i18nScope, {name: _.escape(person.name)});
var html = '<span class="sharing_message_container" title="'+title+'" data-placement="bottom">'+
' <i id="sharing_message" class="'+icon+'"></i>'+
'</span>';
Expand Down
12 changes: 12 additions & 0 deletions spec/javascripts/app/helpers/handlebars-helpers_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe("Handlebars helpers", function() {
beforeEach(function() {
Diaspora.I18n.load({people: {helper: {"is_not_sharing": "<%= name %> is not sharing with you"}}});
});

describe("sharingMessage", function() {
it("escapes the person's name", function() {
var person = { name: "\"><script>alert(0)</script> \"><script>alert(0)</script>"};
expect(Handlebars.helpers.sharingMessage(person)).not.toMatch(/<script>/);
});
});
});

0 comments on commit c238329

Please sign in to comment.