[Koha-cvs] koha C4/Members.pm members/memberentry.pl [rel_2_2]

Henri-Damien LAURENT laurenthdl at alinto.com
Tue Mar 20 17:22:33 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Henri-Damien LAURENT <hdl>	07/03/20 16:22:33

Modified files:
	C4             : Members.pm 
	members        : memberentry.pl 

Log message:
	Members information are now quoted in C4/Members.pm just before update or insert.
	memberentry.pl was modified in relation with this modification.
	I am checking if there is other changes.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.6.2.7&r2=1.6.2.8
http://cvs.savannah.gnu.org/viewcvs/koha/members/memberentry.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.5.2.15&r2=1.5.2.16

Patches:
Index: C4/Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.6.2.7
retrieving revision 1.6.2.8
diff -u -b -r1.6.2.7 -r1.6.2.8
--- C4/Members.pm	5 Dec 2006 14:57:55 -0000	1.6.2.7
+++ C4/Members.pm	20 Mar 2007 16:22:33 -0000	1.6.2.8
@@ -100,18 +100,18 @@
 	my $dbh = C4::Context->dbh;
 	$data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
 	$data{'expiry'}=format_date_in_iso($data{'expiry'});
-	my $query="update borrowers set title='$data{'title'}',expiry='$data{'expiry'}',
-	cardnumber='$data{'cardnumber'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}',
-	streetaddress='$data{'streetaddress'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}',
-	altnotes='$data{'altnotes'}',dateofbirth='$data{'dateofbirth'}',contactname='$data{'contactname'}',
-	emailaddress='$data{'emailaddress'}',streetcity='$data{'streetcity'}',
-	altrelationship='$data{'altrelationship'}',othernames='$data{'othernames'}',phoneday='$data{'phoneday'}',
-	categorycode='$data{'categorycode'}',city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}',
-	borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'surname'}',
-	initials='$data{'initials'}',physstreet='$data{'physstreet'}',ethnicity='$data{'ethnicity'}',
-	gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}',
-	textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}',
-	zipcode = '$data{'zipcode'}',homezipcode='$data{'homezipcode'}', sort1='$data{'sort1'}', sort2='$data{'sort2'}'
+	my $query="update borrowers set title=".$dbh->quote($data{'title'}).",expiry=".$dbh->quote($data{'expiry'}).",
+	cardnumber=".$dbh->quote($data{'cardnumber'}).",sex=".$dbh->quote($data{'sex'}).",ethnotes=".$dbh->quote($data{'ethnicnotes'}).",
+	streetaddress=".$dbh->quote($data{'streetaddress'}).",faxnumber=".$dbh->quote($data{'faxnumber'}).",firstname=".$dbh->quote($data{'firstname'}).",
+	altnotes=".$dbh->quote($data{'altnotes'}).",dateofbirth=".$dbh->quote($data{'dateofbirth'}).",contactname=".$dbh->quote($data{'contactname'}).",
+	emailaddress=".$dbh->quote($data{'emailaddress'}).",streetcity=".$dbh->quote($data{'streetcity'}).",
+	altrelationship=".$dbh->quote($data{'altrelationship'}).",othernames=".$dbh->quote($data{'othernames'}).",phoneday=".$dbh->quote($data{'phoneday'}).",
+	categorycode=".$dbh->quote($data{'categorycode'}).",city=".$dbh->quote($data{'city'}).",area=".$dbh->quote($data{'area'}).",phone=".$dbh->quote($data{'phone'}).",
+	borrowernotes=".$dbh->quote($data{'borrowernotes'}).",altphone=".$dbh->quote($data{'altphone'}).",surname=".$dbh->quote($data{'surname'}).",
+	initials=".$dbh->quote($data{'initials'}).",physstreet=".$dbh->quote($data{'physstreet'}).",ethnicity=".$dbh->quote($data{'ethnicity'}).",
+	gonenoaddress=".$dbh->quote($data{'gna'}).",lost=".$dbh->quote($data{'lost'}).",debarred=".$dbh->quote($data{'debarred'}).",
+	textmessaging=".$dbh->quote($data{'textmessaging'}).", branchcode =".$dbh->quote($data{'branchcode'}).",
+	zipcode =".$dbh->quote($data{'zipcode'}).",homezipcode=".$dbh->quote($data{'homezipcode'}).", sort1=".$dbh->quote($data{'sort1'}).", sort2=".$dbh->quote($data{'sort2'})."
 	where borrowernumber=$data{'borrowernumber'}";
 	my $sth=$dbh->prepare($query);
 	$sth->execute;
@@ -151,13 +151,13 @@
 	my $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
 	firstname,altnotes,dateofbirth,contactname,emailaddress,textmessaging,dateenrolled,streetcity,
 	altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
-	initials,ethnicity,physstreet,branchcode,zipcode,homezipcode,debarred,gonenoaddress,lost,sort1,sort2) values ('$data{'title'}','$data{'expiry'}','$data{'cardnumber'}',
-	'$data{'sex'}','$data{'ethnotes'}','$data{'streetaddress'}','$data{'faxnumber'}',
-	'$data{'firstname'}','$data{'altnotes'}','$data{'dateofbirth'}','$data{'contactname'}','$data{'emailaddress'}','$data{'textmessaging'}',
-	'$data{'joining'}','$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
-	'$data{'phoneday'}','$data{'categorycode'}','$data{'city'}','$data{'area'}','$data{'phone'}',
-	'$data{'borrowernotes'}','$data{'altphone'}','$data{'surname'}','$data{'initials'}',
-	'$data{'ethnicity'}','$data{'physstreet'}','$data{'branchcode'}','$data{'zipcode'}','$data{'homezipcode'}','$data{'debarred'}','$data{'gonenoaddress'}','$data{'lost'}','$data{'sort1'}','$data{'sort2'}')";
+	initials,ethnicity,physstreet,branchcode,zipcode,homezipcode,debarred,gonenoaddress,lost,sort1,sort2) values (".$dbh->quote($data{'title'}).",".$dbh->quote($data{'expiry'}).",".$dbh->quote($data{'cardnumber'}).",".
+	$dbh->quote($data{'sex'}).",".$dbh->quote($data{'ethnotes'}).",".$dbh->quote($data{'streetaddress'}).",".$dbh->quote($data{'faxnumber'}).",".
+	$dbh->quote($data{'firstname'}).",".$dbh->quote($data{'altnotes'}).",".$dbh->quote($data{'dateofbirth'}).",".$dbh->quote($data{'contactname'}).",".$dbh->quote($data{'emailaddress'}).",".$dbh->quote($data{'textmessaging'}).",".
+	$dbh->quote($data{'joining'}).",".$dbh->quote($data{'streetcity'}).",".$dbh->quote($data{'altrelationship'}).",".$dbh->quote($data{'othernames'}).",".
+	$dbh->quote($data{'phoneday'}).",".$dbh->quote($data{'categorycode'}).",".$dbh->quote($data{'city'}).",".$dbh->quote($data{'area'}).",".$dbh->quote($data{'phone'}).",".
+	$dbh->quote($data{'borrowernotes'}).",".$dbh->quote($data{'altphone'}).",".$dbh->quote($data{'surname'}).",".$dbh->quote($data{'initials'}).",".
+	$dbh->quote($data{'ethnicity'}).",".$dbh->quote($data{'physstreet'}).",".$dbh->quote($data{'branchcode'}).",".$dbh->quote($data{'zipcode'}).",".$dbh->quote($data{'homezipcode'}).",".$dbh->quote($data{'debarred'}).",".$dbh->quote($data{'gonenoaddress'}).",".$dbh->quote($data{'lost'}).",".$dbh->quote($data{'sort1'}).",".$dbh->quote($data{'sort2'}).")";
 	my $sth=$dbh->prepare($query);
 	$sth->execute;
 	$sth->finish;

Index: members/memberentry.pl
===================================================================
RCS file: /sources/koha/koha/members/memberentry.pl,v
retrieving revision 1.5.2.15
retrieving revision 1.5.2.16
diff -u -b -r1.5.2.15 -r1.5.2.16
--- members/memberentry.pl	26 Sep 2006 10:04:16 -0000	1.5.2.15
+++ members/memberentry.pl	20 Mar 2007 16:22:33 -0000	1.5.2.16
@@ -2,7 +2,7 @@
 # NOTE: This file uses standard 8-space tabs
 #       DO NOT SET TAB SIZE TO 4
 
-# $Id: memberentry.pl,v 1.5.2.15 2006/09/26 10:04:16 tipaul Exp $
+# $Id: memberentry.pl,v 1.5.2.16 2007/03/20 16:22:33 hdl Exp $
 
 #script to set up screen for modification of borrower details
 #written 20/12/99 by chris at katipo.co.nz
@@ -67,8 +67,8 @@
 	my @names=$input->param;
 	foreach my $key (@names){
 		$data{$key}=$input->param($key);
-		$data{$key}=~ s/\'/\\\'/g;
-		$data{$key}=~ s/\"/\\\"/g;
+# 		$data{$key}=~ s/\'/\\\'/g;
+# 		$data{$key}=~ s/\"/\\\"/g;
 	}
 	my @errors;
 	if ($data{'cardnumber'} eq ''){





More information about the Koha-cvs mailing list