Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: array_key_exists()


ansa

Recommended Posts

Does somebody know how to correct this warning?

I am devastated, all went so smooth, and today surprise, surprise. Anytime I enter the site (Catalog/index.php) I am getting this warning.

 

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in C:\Inetpub\wwwroot\xxxxx\catalog\includes\functions\sessions.php on line 137

 

sessions.php - line 137:

 

Line function tep_session_is_registered($variable) {

// >>> BEGIN REGISTER_GLOBALS

// return session_is_registered($variable);

return array_key_exists($variable,$_SESSION);

// <<< END REGISTER_GLOBALS

}

 

Thanks in advance

 

Andrew

Link to comment
Share on other sites

My includ/func/sessions.php has no such lines.

 

Maybe try uploading a fresh sessions.php?

Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Link to comment
Share on other sites

My includ/func/sessions.php has no such lines.

 

Maybe try uploading a fresh sessions.php?

Hi ,

I checked files and certainly the original includes/session.php has no such codes.

These codes had been applied along with the: Register Globals v1.5_bug_fixes_1.

Here is the contribution from October 5/2006 by ?splauts? pretty recent one which explains this warning. http://www.oscommerce.com/community/contri...1.5_bug_fixes_1.

 

I found a bug in the bug fix.. This is the updated bug fix file with only the following change made:

 

function tep_session_is_registered($variable) {

// >>> BEGIN REGISTER_GLOBALS

// return session_is_registered($variable);

return (isset($_SESSION) && array_key_exists($variable,$_SESSION));

// <<< END REGISTER_GLOBALS

}

 

The isset is required to prevent a possible array_key_exist warning. This happens when tep_session_is_registered is called when no $_SESSION array yet exists.

 

I turned off Force Cookie Use in the admin panell. The warning disapears. It is good for now. But here coms onother question ????..

 

Andrew

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...