aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/cgi_pgsql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/cgi_pgsql.rb')
-rw-r--r--lib/sisu/v3dv/cgi_pgsql.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sisu/v3dv/cgi_pgsql.rb b/lib/sisu/v3dv/cgi_pgsql.rb
index 48d49774..26a85874 100644
--- a/lib/sisu/v3dv/cgi_pgsql.rb
+++ b/lib/sisu/v3dv/cgi_pgsql.rb
@@ -82,7 +82,7 @@ module SiSU_CGI_PgSQL
end
else put "WARNING: no postgresql database available, (have you created one?)"
end
- serve.sort!
+ serve=serve.sort
f1,f2,f3='','',''
serve.each do |x|
f1 << %{ <option value="#{Db[:name_prefix]}#{x}">#{x}</option>\n} unless x =~/apache|sisu\/image/ #check
@@ -151,12 +151,12 @@ module SiSU_CGI_PgSQL
elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q)
end
search_construct=[]
- if @c
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~\( '")
- unescaped_search.gsub!(/(.+)/,"#{@l}~\( '\\1' \)")
+ unescaped_search=if @c
+ unescaped_search.gsub(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~\( '").
+ gsub(/(.+)/,"#{@l}~\( '\\1' \)")
else
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~*\( '")
- unescaped_search.gsub!(/(.+)/,"#{@l}~*\( '\\1' \)")
+ unescaped_search.gsub(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~*\( '").
+ gsub(/(.+)/,"#{@l}~*\( '\\1' \)")
end
search_construct << unescaped_search
search_construct=search_construct.join(' ')
@@ -173,11 +173,11 @@ module SiSU_CGI_PgSQL
<<-'WOK_SQL'
@search_text,@search_endnotes='',''
search[:text].flatten.each {|x| @search_text << "#{x} AND " }
- @search_text=@search_text.gsub!(/AND\s+$/m,'') #watch
- @search_text.gsub!(/(doc_objects\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)')
+ @search_text=@search_text.gsub(/AND\s+$/m,''). #watch
+ gsub(/(doc_objects\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)')
search[:endnotes].flatten.each {|x| @search_endnotes << "#{x} AND " }
- @search_endnotes=@search_endnotes.gsub!(/AND\s+$/m,'') #watch
- @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)')
+ @search_endnotes=@search_endnotes.gsub(/AND\s+$/m,''). #watch
+ gsub(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)')
end
WOK_SQL
end