If you’re running an eCommerce website using Lemonstand V1 (which is now unsupported since their V2 is the new hot stuff) and have recently upgraded your server to PHP 5.5+, you may run into a deprecated error when using Braintree Payments.
The error is in /modules/shop/payment_types/shop_braintree_transpredirect_payment/Braintree/Util.php
and is pretty easy to fix.
There are two functions using the deprecated /e
modifier: delimiterToCamelCase
& camelCaseToDelimiter
.
The fixed versions of these methods are:
delimiterToCamelCase
public static function delimiterToCamelCase($string, $delimiter = '[\-\_]')
{
return preg_replace_callback('/' . $delimiter . '(\w)/',function($matches) {
return strtoupper($matches[1]);
},$string);
}
camelCaseToDelimiter
public static function camelCaseToDelimiter($string, $delimiter = '-')
{
return preg_replace_callback('/([A-Z])/',function($matches) use ($delimiter) {
return $delimiter.strtolower($matches[1]);
},$string);
}