Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: htmlspecialchars()


blr044

Recommended Posts

I installed PWA V 1.65

 

As doing a test run, after clicking checkout to continue without creating a account. Then once at catalog/checkout_shipping.php & checkout_payment.php, I notice the address is not in the upper right corner. I continued on thinking maybe it is color of text problem. Then once at catalog/checkout_confirmation.php I receive these two errors:

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /hsphere/local/home2/brussell/brs-giftshop.com/oscommerce2/catalog/includes/functions/general.php on line 42

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /hsphere/local/home2/brussell/brs-giftshop.com/oscommerce2/catalog/includes/functions/general.php on line 42

 

After searching I found a few - one at http://www.oscommerce.com/forums/lofiversion/i...hp?t199587.html

 

I did try this code:

In catalog\includes\functions\general.php find in tep_address_format:

} elseif (isset($address['country']) && tep_not_null($address['country'])) {
$country = tep_output_string_protected($address['country']);

and replace with

} elseif (isset($address['country']) && tep_not_null($address['country'])) {
$country = tep_output_string_protected($address['country']['title']);

 

After that change this is what I get then:

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /hsphere/local/home2/brussell/brs-giftshop.com/oscommerce2/catalog/includes/functions/general.php on line 42

 

The other method I tried was this:

if (isset($address['country']['id']) && tep_not_null($address['country']['id'])) {
     $country = tep_get_country_name($address['country']['id']);

     if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
       $state = tep_get_zone_code($address['country']['id'], $address['zone_id'], $state);
     }
   } elseif (isset($address['country']) && tep_not_null($address['country'])) {
     $country = tep_output_string_protected($address['country']);
   } else {
     $country = '';
   }

 

Tried to purchase again. Now I get my first again.

 

But I continue through the process, I do end up at my main index page with an email in box showing my purchase.

 

So am hoping that some one else any other suggestions.

 

Thanks.

 

blr044

Link to comment
Share on other sites

  • 5 weeks later...

Scroll down a bit from the above change where you add the [title] and find

 

  $statecomma = '';
$streets = $street;
if ($suburb != '') $streets = $street . $cr . $suburb;
if ($country == '') $country = tep_output_string_protected($address['country']);
if ($state != '') $statecomma = $state . ', ';

 

and change that to

 

  $statecomma = '';
$streets = $street;
if ($suburb != '') $streets = $street . $cr . $suburb;
if ($country == '') $country = tep_output_string_protected($address['country']['title']);
if ($state != '') $statecomma = $state . ', ';

 

That should do it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...