Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DomCrawler] Allow using non-absolute base URIs#28035

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromjaviereguiluz:fix_12318
Aug 2, 2018

Conversation

@javiereguiluz
Copy link
Member

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#12318
LicenseMIT
Doc PR-

@xabbuh@stof I implemented in this PR your comments from#12318

@javiereguiluz
Copy link
MemberAuthor

In the latest commit1f797ea I made the constructor argument optional, because this is probably what the issue reporter wanted in the first place. If we agree with this ... we should rebase into master as a new feature.

@javiereguiluz
Copy link
MemberAuthor

@stof do you agree that we should rebase this onmaster and treat it as a new feature? Thanks!

@stof
Copy link
Member

We could indeed consider that a new feature rather than a bugfix.

@javiereguiluzjaviereguiluz changed the title[DomCrawler] Allow using non-absolute base URIs[WIP] [DomCrawler] Allow using non-absolute base URIsJul 24, 2018
@javiereguiluzjaviereguiluz changed the base branch from2.8 tomasterJuly 24, 2018 18:12
@javiereguiluzjaviereguiluz changed the title[WIP] [DomCrawler] Allow using non-absolute base URIs[DomCrawler] Allow using non-absolute base URIsJul 24, 2018
@xabbuh
Copy link
Member

IMO there is one downside with this new approach: Previously, you could safe callgetUri() as the object was in a valid state. Now you could run into exceptions based on the internal state. That's probably something consuming code isn't prepared for.

javiereguiluz reacted with thumbs up emoji

@javiereguiluz
Copy link
MemberAuthor

@xabbuh you are right! I've refactored this to introduce the new feature without changing the current behavior much. Thanks!

@nicolas-grekas
Copy link
Member

(rebase needed)

$this->currentUri =$currentUri;

$elementUriIsRelative =null ===parse_url(trim($this->getRawUri()),PHP_URL_SCHEME);
$baseUriIsAbsolute =\in_array(strtolower(substr($this->currentUri,0,4)),array('http','file'));
Copy link
Member

Choose a reason for hiding this comment

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

Should we usestrpos() here instead?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It's the same code as in the older branches, so we know it works and I'd prefer to not change it 😅

@javiereguiluzjaviereguiluz added Feature and removed Bug labelsJul 27, 2018
@javiereguiluzjaviereguiluz modified the milestones:2.8,nextJul 27, 2018
@fabpot
Copy link
Member

Thank you@javiereguiluz.

@fabpotfabpot merged commit130119f intosymfony:masterAug 2, 2018
fabpot added a commit that referenced this pull requestAug 2, 2018
…reguiluz)This PR was squashed before being merged into the 4.2-dev branch (closes#28035).Discussion----------[DomCrawler] Allow using non-absolute base URIs| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#12318| License       | MIT| Doc PR        | -@xabbuh@stof I implemented in this PR your comments from#12318Commits-------130119f [DomCrawler] Allow using non-absolute base URIs
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

6 participants

@javiereguiluz@stof@xabbuh@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp