Jump to content

general.php coding trouble install for SSL


MichelleC

Recommended Posts

Need help with code for general.php file.

 

I get this warning on my confirmation page of checkout for my site.

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/username/public_html/store/includes/functions/general.php on line 42

 

I have installed SSL dedicated certificate to osCommerce setup/dedicated server. I edited the files for Includes-configure.php and Admin-Includes-configure.php. My site shows the https:// in the URL address and the lock shows at the bottom of the IE browser. Everything seems to work accept for this error message on the confirmation checkout page.

 

Do I need to assign something to the following code? What in the following area of code in the general.php file needs to be changed for the SSL certificate to work?

 

Thanks

 

 

<?php

/*

$Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Stop from parsing any further PHP code

function tep_exit() {

tep_session_close();

exit();

}

 

////

// Redirect to another page or site

function tep_redirect($url) {

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL

}

}

 

header('Location: ' . $url);

 

tep_exit();

}

 

////

// Parse the data used in the html tags to ensure the tags will not break

function tep_parse_input_field_data($data, $parse) {

return strtr(trim($data), $parse);

}

 

function tep_output_string($string, $translate = false, $protected = false) {

if ($protected == true) {

return htmlspecialchars($string);

} else {

if ($translate == false) {

return tep_parse_input_field_data($string, array('"' => '"'));

} else {

return tep_parse_input_field_data($string, $translate);

}

}

}

 

function tep_output_string_protected($string) {

return tep_output_string($string, false, true);

}

 

function tep_sanitize_string($string) {

$string = ereg_replace(' +', ' ', trim($string));

 

return preg_replace("/[<>]/", '_', $string);

}

 

 

try using strip_tags ;D

 

 

<?php
/*
$Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

////
// Stop from parsing any further PHP code
function tep_exit() {
tep_session_close();
exit();
}

////
// Redirect to another page or site
function tep_redirect($url) {
if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}

header('Location: ' . $url);

tep_exit();
}

////
// Parse the data used in the html tags to ensure the tags will not break
function tep_parse_input_field_data($data, $parse) {
return strtr(trim($data), $parse);
}

function tep_output_string($string, $translate = false, $protected = false) {
if ($protected == true) {
return strip_tags($string);
} else {
if ($translate == false) {
return tep_parse_input_field_data($string, array('"' => '"'));
} else {
return tep_parse_input_field_data($string, $translate);
}
}
}

function tep_output_string_protected($string) {
return tep_output_string($string, false, true);
}

function tep_sanitize_string($string) {
$string = ereg_replace(' +', ' ', trim($string));

return preg_replace("/[<>]/", '_', $string);
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.