[freeside-commits] freeside/httemplate/search sql.html,1.6,1.7
Ivan,,,
ivan at wavetail.420.am
Sat Jun 5 20:01:49 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv22177/search
Modified Files:
sql.html
Log Message:
fix sql query, RT#8035
Index: sql.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/sql.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- sql.html 8 Oct 2007 19:14:28 -0000 1.6
+++ sql.html 6 Jun 2010 03:01:47 -0000 1.7
@@ -1,8 +1,7 @@
<% include( 'elements/search.html',
'title' => 'Query Results',
'name' => 'rows',
- 'query' => 'SELECT '. ( $cgi->param('sql')
- || errorpage('Empty query') ),
+ 'query' => "SELECT $sql",
)
%>
<%init>
@@ -10,4 +9,7 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Raw SQL');
+my $sql = $cgi->param('sql') or errorpage('Empty query');
+$sql =~ s/;+\s*$//; #remove trailing ;
+
</%init>
More information about the freeside-commits
mailing list