mpay24/mpay24-php

Mpay24Order.php __set() preg_match to strict

Closed this issue · 2 comments

if (preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match)) {

This preg_match breaks strings like descriptions with numbers that matches the pattern.

Tested with ShoppingCart->Item( $item_key )->Description = "10,00 € fee"
False Result: 10.00

Requirement: preg_match should not replace attributes / values that are defined as strings in MDXI.xsd (a) or should at least not trim string after matching substring (b).
True Result (a): 10,00 € fee
True Result (b): 10.00 € fee

@soeurdefeo can you check if this is now solved in the last PR #90 that was now merged into the master tree?

fixed in v5.0.0 (#90)