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

xml cannot be empty while reading #183

Closed mrow4a closed 4 years ago

mrow4a commented 4 years ago

PR https://github.com/sabre-io/xml/pull/166 is incomplete. It still allows this situation to happen in an infinite loop:

XMLReader::XML(): Empty string supplied as input at \/Users\/mrow4a\/Projects\/www\/octest\/lib\/composer\/sabre\/xml\/lib\/Reader.php#63
XMLReader::read(): Load Data before trying to read at \/Users\/mrow4a\/Projects\/www\/octest\/lib\/composer\/sabre\/xml\/lib\/Reader.php#63
XMLReader::read(): Load Data before trying to read at \/Users\/mrow4a\/Projects\/www\/octest\/lib\/composer\/sabre\/xml\/lib\/Reader.php#63
...

With this MR, now I see exception properly handled:

Exception: {\"Exception\":\"Sabre\\\\
Xml\\\\ParseException\",\"Message\":\"The input element to parse is empty. Do not attempt to parse\",\"Code\":0,\"Trace\":\"#0 \\\/Users\\\/mrow4a\\\/Projects\\\/www\\\/octest\\\/lib\\\/composer\\\/sabre\
\\/dav\\\/lib\\\/DAV\\\/Client.php(419)
mrow4a commented 4 years ago

@DeepDiver1975 could you have a look?

codecov[bot] commented 4 years ago

Codecov Report

Merging #183 into master will increase coverage by 4.22%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #183      +/-   ##
============================================
+ Coverage     93.38%   97.61%   +4.22%     
  Complexity      112      112              
============================================
  Files            15       13       -2     
  Lines           484      461      -23     
============================================
- Hits            452      450       -2     
+ Misses           32       11      -21     
Impacted Files Coverage Δ Complexity Δ
lib/Service.php 100.00% <100.00%> (ø) 18.00 <0.00> (ø)
lib/XmlDeserializable.php
lib/Version.php

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 03a31ca...f03e438. Read the comment docs.