From 0f4d2e40fb762a91b5133a5f45910c106b6f98a8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 25 Mar 2016 19:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9A=84=E8=AF=AD=E5=8F=A5=EF=BC=8C=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E9=83=BD=E8=A6=81=E5=8A=A0=E4=B8=8Aescape'/'?= =?UTF-8?q?;=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=96=87=E7=AB=A0margin=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/principal.rb | 2 +- app/views/org_document_comments/new.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/principal.rb b/app/models/principal.rb index 2c8465538..0c87ec0c6 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -44,7 +44,7 @@ class Principal < ActiveRecord::Base else pattern = "%#{q}%".gsub("/","//").gsub("_","/_") # sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ") - sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p) escape '/'" + sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) escape '/' or LOWER(login) LIKE LOWER(:p) escape '/' or LOWER(mail) LIKE LOWER(:p) escape '/'" params = {:p => pattern} if q =~ /^(.+)\s+(.+)$/ a, b = "#{$1}%", "#{$2}%" diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb index 24dd7dcfe..cf4ffddcf 100644 --- a/app/views/org_document_comments/new.html.erb +++ b/app/views/org_document_comments/new.html.erb @@ -38,7 +38,7 @@
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
- +