Skip to content
Extraits de code Groupes Projets
Valider 480384a0 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge branch 'stable' into develop

parents 0aa453e4 dc576fb0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -79,6 +79,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure. ...@@ -79,6 +79,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
* Fix mobile photos index page [#6243](https://github.com/diaspora/diaspora/pull/6243) * Fix mobile photos index page [#6243](https://github.com/diaspora/diaspora/pull/6243)
* Fix conversations view with no contacts [#6266](https://github.com/diaspora/diaspora/pull/6266) * Fix conversations view with no contacts [#6266](https://github.com/diaspora/diaspora/pull/6266)
* Links in the left sidebar are now clickable on full width [#6267](https://github.com/diaspora/diaspora/pull/6267) * Links in the left sidebar are now clickable on full width [#6267](https://github.com/diaspora/diaspora/pull/6267)
* Guard against passing nil into person\_image\_tag [#6286](https://github.com/diaspora/diaspora/pull/6286)
## Features ## Features
......
...@@ -32,6 +32,7 @@ module PeopleHelper ...@@ -32,6 +32,7 @@ module PeopleHelper
end end
def person_image_tag(person, size = :thumb_small) def person_image_tag(person, size = :thumb_small)
return "" if person.nil? || person.profile.nil?
image_tag(person.profile.image_url(size), alt: person.name, class: "avatar img-responsive center-block", image_tag(person.profile.image_url(size), alt: person.name, class: "avatar img-responsive center-block",
title: person.name, "data-person_id" => person.id) title: person.name, "data-person_id" => person.id)
end end
......
...@@ -117,6 +117,24 @@ describe NotificationsController, :type => :controller do ...@@ -117,6 +117,24 @@ describe NotificationsController, :type => :controller do
expect(assigns[:notifications].count).to eq(1) expect(assigns[:notifications].count).to eq(1)
end end
end end
context "after deleting a person" do
before do
user = FactoryGirl.create(:user_with_aspect)
user.share_with(alice.person, user.aspects.first)
user.person.delete
end
it "succeeds" do
get :index
expect(response).to be_success
end
it "succeeds on mobile" do
get :index, format: :mobile
expect(response).to be_success
end
end
end end
describe "#read_all" do describe "#read_all" do
......
...@@ -23,6 +23,9 @@ describe PeopleHelper, :type => :helper do ...@@ -23,6 +23,9 @@ describe PeopleHelper, :type => :helper do
end end
describe "#person_image_tag" do describe "#person_image_tag" do
it "returns an empty string if person is nil" do
expect(person_image_tag(nil)).to eq("")
end
it "should not allow basic XSS/HTML" do it "should not allow basic XSS/HTML" do
@person.profile.first_name = "I'm <h1>Evil" @person.profile.first_name = "I'm <h1>Evil"
@person.profile.last_name = "I'm <h1>Evil" @person.profile.last_name = "I'm <h1>Evil"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter