-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DomCrawler] always pass base href to subcrawlers #16028
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
Conversation
Make sure that all relevant information is passed to created crawlers. To avoid future regressions, this commit backports the approach taken by @stof in symfony#15934 to have a single place in the class that is responsible to create subcrawler instances.
c615560
to
3d9a748
Compare
@@ -370,7 +370,7 @@ public function each(\Closure $closure) | |||
*/ | |||
public function slice($offset = 0, $length = -1) | |||
{ | |||
return new static(iterator_to_array(new \LimitIterator($this, $offset, $length)), $this->uri); |
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.
for reference, this is the place where the baseHref was missing.
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.
Yes, in #15934 I asked to backport this to the 2.3
branch, but realised that the slice()
method was introduced later. That's why I did not backport your changes to Symfony 2.3.
I'm 👍 on backporting this |
👍 Status: Reviewed |
Thank you @xabbuh. |
This PR was merged into the 2.7 branch. Discussion ---------- [DomCrawler] always pass base href to subcrawlers | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Make sure that all relevant information is passed to created crawlers. To avoid future regressions, this commit backports the approach taken by @stof in #15934 to have a single place in the class that is responsible to create subcrawler instances. Commits ------- 3d9a748 [DomCrawler] always pass base href to subcrawlers
Make sure that all relevant information is passed to created crawlers.
To avoid future regressions, this commit backports the approach taken by
@stof in #15934 to have a single place in the class that is responsible
to create subcrawler instances.