sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
516 stars 77 forks source link

Fixed error where valueobject has eaten too much #229

Closed mrbig closed 1 year ago

mrbig commented 2 years ago

This fixes a bug, when valueobject is an empty element like In this situation the deserializer did read one more, thus ending up a level higher than required.

I have also attached a unit test to demonstrate the problem. With the original code this xml did throw an error.

evert commented 2 years ago

Pretty wild that people are still finding bugs, but LGTM!

codecov[bot] commented 2 years ago

Codecov Report

Merging #229 (f5073dc) into master (97ddaf2) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #229   +/-   ##
=========================================
  Coverage     96.90%   96.90%           
  Complexity      116      116           
=========================================
  Files            13       13           
  Lines           485      485           
=========================================
  Hits            470      470           
  Misses           15       15           
Impacted Files Coverage Δ
lib/Deserializer/functions.php 89.69% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

mrbig commented 2 years ago

Pretty wild that people are still finding bugs, but LGTM!

agree with that, I was surprised, that this haven't been found yet.

Thanks for the great software!

phil-davis commented 1 year ago

This has been here for a while! I will have a look and see if I can make bugfix patch releases for major versions 2, 3 and 4.

phil-davis commented 1 year ago

Backport to v3 branch is in PR #241 Backport to 2.1 branch is in PR #242 (actually that is not needed) Backport to 2.2 branch is in PR #243 (and I will make a next patch release of the 2.2 series)