Jump to content
Sign in to follow this  
blr044

Warning: htmlspecialchars()

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://forums.oscommerce.com/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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×