Dear dev team,
we are seeing two PHP warnings, probably since the upgrade to PHP 8.
Environment:
- VirtueMart 3.8.8 10472
- Joomla 3.9.27
- PHP 8.0.14
The warnings appear in apache error.log every time someone does a check out with Paypal as a guest.
Warning 1:
PHP message: PHP Warning: Undefined variable $get_magic_quotes_exists in /var/www/plugins/vmpayment/paypal/paypal/helpers/paypal.php on line 647
Suggested bugfix change line 647 in /var/www/plugins/vmpayment/paypal/paypal/helpers/paypal.php:
New code:
if (isset($get_magic_quotes_exists) && $get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
Current code:
if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
Warning 2:
PHP message: PHP Warning: Undefined property: stdClass::$_guest in /var/www/components/com_virtuemart/helpers/cart.php on line 202'
Suggested bug fix add line 36 in /var/www/components/com_virtuemart/helpers/cart.php:
New code:
var $_guest = false;
Best regards,
Stefan
Thank you. I fixed the first a bit different (just settting $get_magic_quotes_exists to false, if the function is not defined.
And the other thing. yes that is already fixed in the new core, but added with false
Quote
self::$_cart->_guest = true;
self::$_cart->loadedCart = false;
if (!empty($sessionCart)) {