atgp / factur-x

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

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

Closed mahdiabderraouf closed 1 year 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 1 year ago

Pull request merged Thanks