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

Fixed absolute url generation for query strings and hash urls#23261

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

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranzalexander-schranz commentedJun 22, 2017
edited
Loading

QA
Branch?2.7, ...
Bug fix?yes
New feature?no
BC breaks?yes? absolute_url will change its output but the old was incorrect
Deprecations?no
Tests pass?yes?
Fixed ticketsfixes#23260
LicenseMIT

Fixed absolute url generation for query strings

@stof
Copy link
Member

would be great to check if the Link URL resolution in DomCrawler suffers from the same issue

@alexander-schranz
Copy link
ContributorAuthor

@stoff Looks good there but seems we need to handle# also correctly in the absolute_url.https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DomCrawler/AbstractUriElement.php#L100

@alexander-schranzalexander-schranz changed the titleFixed absolute url generation for query stringsFixed absolute url generation for query strings and hash urlsJun 22, 2017
@alexander-schranz
Copy link
ContributorAuthor

will change the base to 2.7 think thats the oldest supported version?

@alexander-schranzalexander-schranz changed the base branch from2.8 to2.7June 22, 2017 11:43
@xabbuhxabbuh added this to the2.7 milestoneJun 22, 2017
@alexander-schranz
Copy link
ContributorAuthor

I'm not sure why php7 keeps failing on travis

$path =$this->requestContext->getPathInfo().($queryString ?'?'.$queryString :'').$path;
}

if ('?' ===$path[0]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can useelseif here and also below?

$path =$request->getRequestUri().$path;
}

if ('?' ===$path[0]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

alsoelseif?

array('http://localhost/foo/bar#baz','#baz','/foo/bar'),
array('http://localhost/foo/bar?baz=1#baz','?baz=1#baz','/foo/bar?foo=1'),
array('http://localhost/foo/baz?baz=1#baz','baz?baz=1#baz','/foo/bar?foo=1'),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add this test case?

array('http://localhost/foo/bar?0#foo','#foo','/foo/bar?0'),

I think your current solution will strip out the existing?0 query string. I know its an edge case but still 😄

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

test added seems not failing as a0 as string is true.

Copy link
Contributor

Choose a reason for hiding this comment

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

php -r"var_dump((bool)'0');"

==>bool(false)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@dmaicher can you tell me whats wrong with the test as it should fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah this is only executed when no current request is given (CLI) and the request context is used instead 😉

So your changes from L 73-79 are currently not covered by tests. You need to add some more test cases into thegetGenerateAbsoluteUrlRequestContextData provider 😉

@Tobion
Copy link
Contributor

👍

@fabpot
Copy link
Member

Thank you@alexander-schranz.

fabpot added a commit that referenced this pull requestJul 6, 2017
…rls (alexander-schranz)This PR was squashed before being merged into the 2.7 branch (closes#23261).Discussion----------Fixed absolute url generation for query strings and hash urls| Q             | A| ------------- | ---| Branch?       | 2.7, ...| Bug fix?      | yes| New feature?  |no| BC breaks?    | yes? absolute_url will change its output but the old was incorrect| Deprecations? |no| Tests pass?   | yes?| Fixed tickets |fixes#23260| License       | MITFixed absolute url generation for query stringsCommits-------89ad27d Fixed absolute url generation for query strings and hash urls
@fabpotfabpot closed thisJul 6, 2017
This was referencedJul 17, 2017
@alexander-schranzalexander-schranz deleted the bugfix/absolute-url branchOctober 28, 2018 10:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@dmaicherdmaicherdmaicher left review comments

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

8 participants

@alexander-schranz@stof@Tobion@fabpot@dmaicher@javiereguiluz@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp