diff options
Diffstat (limited to 'vendor/sabre/xml/lib/Service.php')
-rw-r--r-- | vendor/sabre/xml/lib/Service.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vendor/sabre/xml/lib/Service.php b/vendor/sabre/xml/lib/Service.php index 9a2c47794..596c93cc4 100644 --- a/vendor/sabre/xml/lib/Service.php +++ b/vendor/sabre/xml/lib/Service.php @@ -115,12 +115,13 @@ class Service // Unfortunately the XMLReader doesn't support streams. When it // does, we can optimize this. $input = (string) stream_get_contents($input); + } - // If input is an empty string, then its safe to throw exception - if ('' === $input) { - throw new ParseException('The input element to parse is empty. Do not attempt to parse'); - } + // If input is empty, then its safe to throw exception + if (empty($input)) { + throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } + $r = $this->getReader(); $r->contextUri = $contextUri; $r->XML($input, null, $this->options); @@ -158,12 +159,13 @@ class Service // Unfortunately the XMLReader doesn't support streams. When it // does, we can optimize this. $input = (string) stream_get_contents($input); + } - // If input is empty string, then its safe to throw exception - if ('' === $input) { - throw new ParseException('The input element to parse is empty. Do not attempt to parse'); - } + // If input is empty, then its safe to throw exception + if (empty($input)) { + throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } + $r = $this->getReader(); $r->contextUri = $contextUri; $r->XML($input, null, $this->options); |