[LON-CAPA-cvs] cvs: loncom / lonsql
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 25 Aug 2007 13:45:56 -0000
raeburn Sat Aug 25 09:45:56 2007 EDT
Modified files:
/loncom lonsql
Log:
Remove any spaces adjacent to the comma separator in a lastname,firstname search.
Index: loncom/lonsql
diff -u loncom/lonsql:1.84 loncom/lonsql:1.85
--- loncom/lonsql:1.84 Wed Aug 8 18:24:36 2007
+++ loncom/lonsql Sat Aug 25 09:45:56 2007
@@ -3,7 +3,7 @@
# The LearningOnline Network
# lonsql - LON TCP-MySQL-Server Daemon for handling database requests.
#
-# $Id: lonsql,v 1.84 2007/08/08 22:24:36 albertel Exp $
+# $Id: lonsql,v 1.85 2007/08/25 13:45:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -457,6 +457,8 @@
$query = "SELECT $fieldlist FROM allusers WHERE (domain = $quoted_dom AND ";
if ($srchby eq 'lastfirst') {
my ($fraglast,$fragfirst) = split(/,/,$srchterm);
+ $fragfirst =~ s/^\s+//;
+ $fraglast =~ s/\s+$//;
if ($srchtype eq 'exact') {
$query .= 'lastname = '.$dbh->quote($fraglast).
' AND firstname = '.$dbh->quote($fragfirst);