atgp / factur-x

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files
MIT License
98 stars 21 forks source link

checkFacturxXsd returns true for wrong profiles if XML is valid #11

Closed mahdiabderraouf closed 2 years ago

mahdiabderraouf commented 3 years ago

Bug description

the method checkFacturxXsd returns true for any wrong profile if the given XML is valid.

How to reproduce ?

call the method checkFacturxXsd with a wrong profil and a valid XML.

$facturx = new Facturx();
$isXSDValid = $facturx->checkFacturxXsd($validXml, 'anywrongprofile');
echo (string) $isXSDValid; // "true"

Solution

Detect profil automaticly only if the given profil is "autodetect". A pull-request has been created for the give solution.

lucas-gp commented 2 years ago

Pull request merged Thanks