diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index ff083fc59..2ff1ddc05 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -15,7 +15,7 @@ class PublicsController < ApplicationController caches_page :host_meta def hcard - @person = Person.find_by_id params[:id] + @person = Person.where(:guid => params[:guid]) unless @person.nil? || @person.owner.nil? render 'publics/hcard' else @@ -48,10 +48,10 @@ class PublicsController < ApplicationController return end - person = Person.find(params[:id]) + person = Person.where(:guid => params[:guid]).first if person.owner_id.nil? - Rails.logger.error("Received post for nonexistent person #{params[:id]}") + Rails.logger.error("Received post for nonexistent person #{params[:guid]}") render :nothing => true, :status => 404 return end diff --git a/config/routes.rb b/config/routes.rb index 7f729c469..a3a980307 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,9 +45,9 @@ Diaspora::Application.routes.draw do #public routes match 'webfinger', :to => 'publics#webfinger' - match 'hcard/users/:id', :to => 'publics#hcard' + match 'hcard/users/:guid', :to => 'publics#hcard' match '.well-known/host-meta',:to => 'publics#host_meta' - match 'receive/users/:id', :to => 'publics#receive' + match 'receive/users/:guid', :to => 'publics#receive' match 'hub', :to => 'publics#hub' #root