[TEP-COMMIT] CVS: catalog/catalog address_book_process.php,1.80,1.81 checkout_shipping_address.php,1.16,1.17 create_account.php,1.67,1.68

cvs-OfajU3CKLf1/[email protected]
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Update of /pack/cvsroots/oscommerce/catalog/catalog
In directory sunsite.dk:/tmp/cvs-serv23224

Modified Files:
	address_book_process.php checkout_shipping_address.php 
	create_account.php 
Log Message:
Fix bug 1464 / 1533

Index: address_book_process.php
===================================================================
RCS file: /pack/cvsroots/oscommerce/catalog/catalog/address_book_process.php,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- address_book_process.php	2003/11/17 20:48:43	1.80
+++ address_book_process.php	2004/02/14 17:34:07	1.81
@@ -103,20 +103,26 @@
       $check = tep_db_fetch_array($check_query);
       $entry_state_has_zones = ($check['total'] > 0);
       if ($entry_state_has_zones == true) {
-        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and zone_name = '" . tep_db_input($state) . "'");
         if (tep_db_num_rows($zone_query) == 1) {
           $zone = tep_db_fetch_array($zone_query);
           $zone_id = $zone['zone_id'];
         } else {
-          $error = true;
+          $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone = tep_db_fetch_array($zone_query);
+            $zone_id = $zone['zone_id'];
+          } else {
+            $error = true;
 
-          $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
+            $messageStack->add('address_book', ENTRY_STATE_ERROR_SELECT);
+          }
         }
       } else {
         if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
           $error = true;
 
-          $messageStack->add('addressbook', ENTRY_STATE_ERROR);
+          $messageStack->add('address_book', ENTRY_STATE_ERROR);
         }
       }
     }

Index: checkout_shipping_address.php
===================================================================
RCS file: /pack/cvsroots/oscommerce/catalog/catalog/checkout_shipping_address.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- checkout_shipping_address.php	2003/11/17 20:58:34	1.16
+++ checkout_shipping_address.php	2004/02/14 17:34:07	1.17
@@ -108,14 +108,20 @@
         $check = tep_db_fetch_array($check_query);
         $entry_state_has_zones = ($check['total'] > 0);
         if ($entry_state_has_zones == true) {
-          $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+          $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and zone_name = '" . tep_db_input($state) . "'");
           if (tep_db_num_rows($zone_query) == 1) {
             $zone = tep_db_fetch_array($zone_query);
             $zone_id = $zone['zone_id'];
           } else {
-            $error = true;
+            $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+            if (tep_db_num_rows($zone_query) == 1) {
+              $zone = tep_db_fetch_array($zone_query);
+              $zone_id = $zone['zone_id'];
+            } else {
+              $error = true;
 
-            $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
+              $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
+            }
           }
         } else {
           if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {

Index: create_account.php
===================================================================
RCS file: /pack/cvsroots/oscommerce/catalog/catalog/create_account.php,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- create_account.php	2003/12/17 16:16:16	1.67
+++ create_account.php	2004/02/14 17:34:07	1.68
@@ -139,14 +139,20 @@
       $check = tep_db_fetch_array($check_query);
       $entry_state_has_zones = ($check['total'] > 0);
       if ($entry_state_has_zones == true) {
-        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and zone_name = '" . tep_db_input($state) . "'");
         if (tep_db_num_rows($zone_query) == 1) {
           $zone = tep_db_fetch_array($zone_query);
           $zone_id = $zone['zone_id'];
         } else {
-          $error = true;
+          $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone = tep_db_fetch_array($zone_query);
+            $zone_id = $zone['zone_id'];
+          } else {
+            $error = true;
 
-          $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
+            $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
+          }
         }
       } else {
         if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.