Skip to content
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

[1.5] Prevent infinite loop on empty xml elements #159

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Jan 9, 2019

Brings #158 to the 1.5 branch

@DeepDiver1975 DeepDiver1975 self-assigned this Jan 9, 2019
@DeepDiver1975 DeepDiver1975 requested review from staabm and evert January 9, 2019 09:20
@DeepDiver1975 DeepDiver1975 force-pushed the bugfix/infinite-loop-1.5 branch from 909e850 to 045dfc1 Compare January 9, 2019 09:37
Copy link
Member

@staabm staabm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

I did not check all the details, but I assume you took the unit tests from the upstream issue 1:1

}
} while ($reader->nodeType !== Reader::END_ELEMENT);

$reader->read();
if (!$reader->read()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the if statement added here? This duplicates also the return of this method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is true - thx for having a closer look.

I added this for debugging purpose to see if read fails at this point under any condition .....

@@ -123,6 +125,40 @@ function testExpect() {
);
}

/**
* @expectedException \Sabre\Xml\LibXMLException

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The support for this annotation will be removed with version 9 of PHPUnit. This would not be a problem if this package did not use the "death star version constraint" on PHPUnit.

My suggestion: use the expectException method instead and define a version for PHPUnit in the Composer configuration – version 8 is around the corner.

Copy link
Member

@staabm staabm Jan 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for noticing.

at first we should get rid of the "death star version constraint".

changes to our unit tests itself are welcome via separate pull requets

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm

thx for noticing.

Right, this was only a notice and should be done in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the 1.5 branch - it is on pure maintenance mode. No idea if we should put any further man power into this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the 1.5 branch - it is on pure maintenance mode. No idea if we should put any further man power into this.

the mentioned issues should be fixed on master.

in 1.5 I would only fix the "death star version constraint"

@DeepDiver1975 DeepDiver1975 force-pushed the bugfix/infinite-loop-1.5 branch from 045dfc1 to fd77b16 Compare January 9, 2019 11:46
@DeepDiver1975 DeepDiver1975 changed the title Prevent infinite loop on empty xml elements [1.5] Prevent infinite loop on empty xml elements Jan 9, 2019
@staabm
Copy link
Member

staabm commented Jan 9, 2019

feel free to merge, in case this is ready.

@DeepDiver1975
Copy link
Member Author

feel free to merge, in case this is ready.

I'm preparing the release right in here as well ... then merge .... then repeat on all other PRs ....

@DeepDiver1975
Copy link
Member Author

@DeepDiver1975 DeepDiver1975 merged commit bc9edbd into 1.5 Jan 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the bugfix/infinite-loop-1.5 branch January 9, 2019 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants