Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deprecated: Assigning the return value of new by reference is deprecated in/admin/includes/classes/xml_5.php on line 25


MTG Mania

Recommended Posts

Hiya.

 

I downloaded and installed the USPS Methods 6.1a module, along with the required xml files, and lo and behold (I knew this wasn't going to be "easy" lol) I get this error in my admin panel when I go to download and re-install the module (per the instructions that came with the add on) Deprecated: Assigning the return value of new by reference is deprecated in /home/xxxxxxx/xxxxxx_xxxx/admin/includes/classes/xml_5.php on line 25.

 

I followed the instructions step by step, and VERY slowly, triple checking the whole way making sure I was putting what goes where in the correct spots. Any ideas on this error and why I am getting it? Any advice on fixing it?

 

Here is the string of coding:

 

//##################################################################################

// XML_unserialize: takes raw XML as a parameter (a string)

// and returns an equivalent PHP data structure

//##################################################################################

function & XML_unserialize(&$xml){

$xml_parser = &new XML(); <--------------------------- LINE 25

$data = &$xml_parser->parse($xml);

$xml_parser->destruct();

return $data;

}

//##################################################################################

// XML_serialize: serializes any PHP data structure into XML

// Takes one parameter: the data to serialize. Must be an array.

//##################################################################################

function & XML_serialize(&$data, $level = 0, $prior_key = NULL){

if($level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; }

while(list($key, $value) = each($data))

Link to comment
Share on other sites

I'm not entirely sure this will work, but try this:

 

$xml_parser = new XML();

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 >

Link to comment
Share on other sites

@@germ

 

Thank you!!! That worked. Buuuuuut.... NOW... I installed, set the settings for everything, click save and WHAMMO!!!

This is my greeting!

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /homel/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Warning: Cannot modify header information - headers already sent by (output started at //admin/modules.php:39) in /home/admin/includes/functions/general.php on line 34

 

Allllllll over my admin panel.

 

 

Here is the code:

 

if (tep_not_null($action)) {

switch ($action) {

case 'save':

reset($HTTP_POST_VARS['configuration']);

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

if( is_array( $value ) ){

$value = implode( ", ", $value);

$value = ereg_replace (", --none--", "", $value);

}

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");

}

tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));

break;

case 'install':

case 'remove':

 

 

And here is funtions:

 

 

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

header('Location: ' . $url); <--------------------- Line 34

 

if (STORE_PAGE_PARSE_TIME == 'true') {

if (!is_object($logger)) $logger = new logger;

$logger->timer_stop();

}

 

exit;

}

 

A little help with this too, please? :sweating: :blush:

Edited by MTG Mania
Link to comment
Share on other sites

Try:

 

$value = preg_replace ('/, --none--/', '', $value);

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 >

Link to comment
Share on other sites

Did you catch the post by the other JIm?

:unsure:

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 >

Link to comment
Share on other sites

You'll have to post the error message.

 

I'm not "magic" like you.

:blush:

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 >

Link to comment
Share on other sites

@@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. :lol: :'(

 

I like the visual....

(w00t)

 

So what';s the code from the file on line 25?

:unsure:

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 >

Link to comment
Share on other sites

@@germ I fixed it (I think, hope pray lol) Thank you so much for helping me!! You, and the others like you have NO idea how much I appreciate it!! Without you guys helping me along the way, I never would have figured HALF of this stuff out!!!

Link to comment
Share on other sites

Hi Magic, congrats... :)

 

So please update the addon then.

 

Sara

 

Do I just download my "fixed" php's and upload it as a "fix" on the add on page that I downloaded it from, or? I have not updated any add on's before.

 

And thanks!! lol Without the 2 Jim's I would have been in a real fix, so the credit is really due to them!!

 

Cindy

Link to comment
Share on other sites

Hi Cindy, best is to upload a new package with comments on what's fixed, how and where.

 

So, zip your version and upload with a new number.

 

Sara

 

Coding is a looooooooot of coffe... and snacks... :)

Link to comment
Share on other sites

Coding is a looooooooot of coffe... and snacks... :)

 

Wondered why I was putiing on weight and feeling hyper :)

Link to comment
Share on other sites

  • 4 weeks later...

Hi Cindy, best is to upload a new package with comments on what's fixed, how and where.

 

So, zip your version and upload with a new number.

 

Sara

 

Coding is a looooooooot of coffe... and snacks... :)

 

I doesn'e look like the new updated files were ever uploaded to the site, because it looks like the most recent version, 6.1b , was added back on February 16, 2012.

 

Would be great if the updated files could be added by somebody ... I could really use it right now!

Link to comment
Share on other sites

  • 1 month later...

Thanks Jim and Jim! This also fixed a checkout problem with OSC 2.3.3 and PHP 5.3 in the /catalog/includes/classes/xml_5.php file. It took me a while to find this thread, but glad I did.

 

Thanks again,

 

Dave

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...