--- loncom/lonsql 2007/08/08 22:24:36 1.84 +++ loncom/lonsql 2007/08/25 13:45:56 1.85 @@ -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 @@ sub make_new_child { $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);