Jump to content
Sign in to follow this  
BeckyLiu

function ereg index

Recommended Posts

I'm pretty much a php n00b and have been trying to google/find how to sort out my ereg depreciatation problems but I have no idea what I'm doing. I've uploaded OSC V2.2 RC2a PHP 5.3 compatible files downloaded from the contributions. I have also installed the product listing contribution to make it list the product horizontally.

 

http://shop.beckyliu.com/index.php?cPath=3_10&sort=2a&filter_id=4

 

This is the error I'm getting on that page above

 

Deprecated: Function ereg() is deprecated in /srv/disk3/548372/www/shop.beckyliu.com/index.php on line 195

 

Line 195

 

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;

 

Really annoyed and worried this is going to keep happening and I'll find more errors. Thanks!

Share this post


Link to post
Share on other sites

I'm pretty much a php n00b and have been trying to google/find how to sort out my ereg depreciatation problems but I have no idea what I'm doing. I've uploaded OSC V2.2 RC2a PHP 5.3 compatible files downloaded from the contributions. I have also installed the product listing contribution to make it list the product horizontally.

 

http://shop.beckyliu.com/index.php?cPath=3_10&sort=2a&filter_id=4

 

This is the error I'm getting on that page above

 

Deprecated: Function ereg() is deprecated in /srv/disk3/548372/www/shop.beckyliu.com/index.php on line 195

 

Line 195

 

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;

 

Really annoyed and worried this is going to keep happening and I'll find more errors. Thanks!

 

Change that piece of code with

 

   if ( (!isset($_GET['sort'])) || (!preg_match('/^[1-8][ad]$/', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $_GET['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;

Share this post


Link to post
Share on other sites

Use the deprecated ereg contribution to look at all of the files that need to be updated.

 

 

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Use the deprecated ereg contribution to look at all of the files that need to be updated.

Is that just for the base osC code, or does that also fix any arbitrary contribution's code? I suspect the former, which means the OP will still have to manually fix any deprecated code found in her added contributions.

 

http://us.php.net/manual/en/migration53.deprecated.php is the full list of PHP calls that may need to be changed, and how to change them.

Edited by MrPhil

Share this post


Link to post
Share on other sites

Yeh MrPhil is right. I have already changed all of the files that needed to be updated through this contribution i think the product listing one effed it up a bit.

 

@pdcelec Thank you so much!! It worked!!!!!!

 

Thanks guys for the quick help!

Share this post


Link to post
Share on other sites

Visit the link below:

 

How to Secure Your Site

 

Pay close attention to "SECURING THE ADMIN" - Yours is vulnerable.

 

It's easier to do a few security fixes now than to clean up a hacked store later.

 

And if you don't secure the admin your shop will be hacked.

 

It's just a question of when...Today, tomorrow, next week, next month... Take your pick

 

They always are.

:'(


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Visit the link below:

 

How to Secure Your Site

 

Pay close attention to "SECURING THE ADMIN" - Yours is vulnerable.

 

It's easier to do a few security fixes now than to clean up a hacked store later.

 

And if you don't secure the admin your shop will be hacked.

 

It's just a question of when...Today, tomorrow, next week, next month... Take your pick

 

They always are.

:'(

 

I've secured it as much as I can for now thanks for the help/tips. Am slowly getting there with my shop now!!

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  

×