From 8687e343f8d65fa608fdff3253e25abe0802b1d1 Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Wed, 4 Jul 2012 17:55:55 +0400 Subject: [PATCH] [issue #554] Fixed tab+space json bug in AJAX. --- app/views/platforms/repositories/_proj_ajax.js.erb | 2 +- app/views/platforms/repositories/_project.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/platforms/repositories/_proj_ajax.js.erb b/app/views/platforms/repositories/_proj_ajax.js.erb index 9fd8431d4..3b00728de 100644 --- a/app/views/platforms/repositories/_proj_ajax.js.erb +++ b/app/views/platforms/repositories/_proj_ajax.js.erb @@ -6,7 +6,7 @@ <% @projects.each do |project| %> [ "<%=j link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project) %>", - "<%= truncate(project.description || '', :length => 60).gsub("\n", ' ').gsub("\r", ' ') %>", + "<%= truncate(project.description || '', :length => 60).gsub(/\n|\r|\t/, ' ') %>", "<%=j link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id) %>" ]<%= project == @projects.last ? '' : ',' %> <% end %> diff --git a/app/views/platforms/repositories/_project.js.erb b/app/views/platforms/repositories/_project.js.erb index fbff4878d..2dd623397 100644 --- a/app/views/platforms/repositories/_project.js.erb +++ b/app/views/platforms/repositories/_project.js.erb @@ -13,7 +13,7 @@ j(link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project)) + "").html_safe %>", - "<%= truncate(project.description || '', :length => 60).gsub("\n", ' ').gsub("\r", ' ') %>", + "<%= truncate(project.description || '', :length => 60).gsub(/\n|\r|\t/, ' ') %>", "<%= if can? :remove_project, @repository j(link_to(' '.html_safe,