mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Improved SEPA description parsing
This commit is contained in:
@@ -28,7 +28,7 @@ class AbnAmroDescription
|
|||||||
{
|
{
|
||||||
// Try to parse the description in known formats.
|
// Try to parse the description in known formats.
|
||||||
$parsed = $this->parseSepaDescription() || $this->parseTRTPDescription() || $this->parseGEABEADescription() || $this->parseABNAMRODescription();
|
$parsed = $this->parseSepaDescription() || $this->parseTRTPDescription() || $this->parseGEABEADescription() || $this->parseABNAMRODescription();
|
||||||
|
|
||||||
// If the description could not be parsed, specify an unknown opposing
|
// If the description could not be parsed, specify an unknown opposing
|
||||||
// account, as an opposing account is required
|
// account, as an opposing account is required
|
||||||
if( !$parsed ) {
|
if( !$parsed ) {
|
||||||
@@ -66,7 +66,7 @@ class AbnAmroDescription
|
|||||||
$type = trim($matches[1]);
|
$type = trim($matches[1]);
|
||||||
|
|
||||||
// SEPA plain descriptions contain several key-value pairs, split by a colon
|
// SEPA plain descriptions contain several key-value pairs, split by a colon
|
||||||
preg_match_all( "/([A-Za-z]+(?=:\s)):\s([A-Za-z 0-9.-]+(?=\s))/", $this->data[ "description" ], $matches, PREG_SET_ORDER );
|
preg_match_all( "/([A-Za-z]+(?=:\s)):\s([A-Za-z 0-9._#-]+(?=\s))/", $this->data[ "description" ], $matches, PREG_SET_ORDER );
|
||||||
|
|
||||||
foreach( $matches as $match ) {
|
foreach( $matches as $match ) {
|
||||||
$key = $match[1];
|
$key = $match[1];
|
||||||
|
Reference in New Issue
Block a user