Skip to content
Extraits de code Groupes Projets
Valider 0aeab944 rédigé par Gonzalo Rodriguez's avatar Gonzalo Rodriguez
Parcourir les fichiers

Related to #1885. Workaround to avoid crashing when searching tags with dots like cubbi.es

What i did was to redirect to the tag without dots, in this case cubbies
I didn't consider a good idea to add route support for /tags/cubbi.es
since it get messed with request formats
parent c63dfb88
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -18,7 +18,7 @@ class PeopleController < ApplicationController
params[:q] ||= params[:term] || ''
if (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length > 1
redirect_to tag_path(:name => params[:q].gsub("#", ""))
redirect_to tag_path(:name => params[:q].gsub(/[#\.]/, ''))
return
end
......
......@@ -72,6 +72,11 @@ describe PeopleController do
get :index, :q => '#babies'
response.should redirect_to('/tags/babies')
end
it 'goes to a tag page if you search for a hash with dots' do
get :index, :q => '#babi.es'
response.should redirect_to('/tags/babies')
end
end
describe '#tag_index' do
......
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