-
Notifications
You must be signed in to change notification settings - Fork 146
Fix Issue #215 #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4.4
Are you sure you want to change the base?
Fix Issue #215 #225
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,7 +215,7 @@ function genXMLFe() | |
| </Ubicacion>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
@@ -1206,7 +1206,7 @@ function genXMLNC() | |
| </Ubicacion>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
|
||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
@@ -2085,7 +2085,7 @@ function genXMLND() | |
| </Ubicacion>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
@@ -2954,7 +2954,7 @@ function genXMLTE() | |
| </Ubicacion>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
@@ -3883,7 +3883,7 @@ function genXMLFec() | |
| <OtrasSenasExtranjero>' . $emisorOtrasSenasExtranjero . '</OtrasSenasExtranjero>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
@@ -4583,7 +4583,7 @@ function genXMLFee() | |
| </Ubicacion>'; | ||
| } | ||
|
|
||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { | ||
| if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { | ||
| $xmlString .= ' | ||
| <Telefono> | ||
| <CodigoPais>' . $emisorCodPaisTel . '</CodigoPais> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The telefono inclusion check only validates length; it doesn’t trim or ensure the value is numeric. Per the v4.4 XSD, is xs:integer, so values like "2222-3333" or trailing spaces would now be emitted and cause schema validation failures. Consider normalizing (trim) and validating digits-only (e.g., ctype_digit after trim, or strip non-digits) before adding , and avoid calling strlen() twice by computing the length once.