mschindler83/fints-hbci-php

Segment splitting incorrect

Opened this issue · 2 comments

roben commented

According to https://www.hbci-zka.de/dokumente/spezifikation_deutsch/fintsv3/FinTS_3.0_Formals_2017-10-06_final_version.pdf (G. Data Dictionary -> Segmentkennung), the splitting in the constructor of Response.php needs to be something like this:

$this->segments = preg_split("/'+(?=[A-Z0-9]{1,6}:\d{1,3}:\d{1,3}(:\d{1,3})?)/", $rawResponse);

roben commented

The old regexp splitted on two subsequent single quotes in transaction texts (''), which is definitely wrong.
Even better would be to filter out binary content (@<length>@), see documentation, which could still contain segment headers (i.e. 'A:1:2) and break stuff.

Ty @roben ! Safed my day!

The owner of this lib is still offline? No answer after buy pro version! Frustrated...