Jump to content
Sign in to follow this  
gayleenp

DPS PxPay - undefined function: htmlspecialchars_decode

Recommended Posts

I've just installed PxPay, and tried to initiate a test transaction. I am able to select DPS as the payment type, but am not getting to the credit card input screen.

 

I get this error:

 

Fatal error: Call to undefined function: htmlspecialchars_decode() in /XXXXXXXXXXXXXXXX/catalog/includes/modules/payment/dps_pxpay.php on line 473

 

Is anyone able to shed light on this?

 

Thanks

Share this post


Link to post
Share on other sites

As of PHP 5.1.0 it's been a "standard" php function (see here)

 

Look in Admin >> Tools >>> Server Info (I think that's where to look) to see what the PHP version is on your server.


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

Thanks Jim. Looks like I've got 4.4.4.

 

The link you provided gave a suggestion as follows - would I need to put the following code within my payment module file (dps_pxpay.php)?

 

*****

Here is how you can get this function in php < 5.1, just make sure this function is before you try and call the function.

 

if (!function_exists('htmlspecialchars_decode')) {

function htmlspecialchars_decode($str, $options="") {

$trans = get_html_translation_table(HTML_SPECIALCHARS, $options);

 

$decode = ARRAY();

foreach ($trans AS $char=>$entity) {

$decode[$entity] = $char;

}

 

$str = strtr($str, $decode);

 

return $str;

}

}

 

*****

Share this post


Link to post
Share on other sites

Sounds like a winner.

:)

 

Do like the note says and "make sure this function is before you try and call the function."

 

I would place it towards the top of the file.


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

I tried all the function options on that page, but unfortunately none of them worked. I still get the same fatal error.

Share this post


Link to post
Share on other sites

I've fixed it. Found this:

 

use html_entity_decode() function it works on php 4

 

Replaced the function and it works just fine. Thanks for your help today Jim.

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  

×