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

Commitd4236ca

Browse files
committed
merged branch fabpot/hinclude-signer (PR#8960)
This PR was merged into the 2.2 branch.Discussion----------[HttpKernel] fix HInclude src (closes#8951)| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#8951| License | MIT| Doc PR | n/afixes a regression introduced in#8879Commits-------49f5027 [HttpKernel] fixer HInclude src (closes#8951)
2 parentseb6b3b0 +49f5027 commitd4236ca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public function render($uri, Request $request, array $options = array())
8080
thrownew \LogicException('You must use a proper URI when using the Hinclude rendering strategy or set a URL signer.');
8181
}
8282

83-
$uri =$this->signer->sign($this->generateFragmentUri($uri,$request));
83+
// we need to sign the absolute URI, but want to return the path only.
84+
$uri =str_replace($request->getSchemeAndHttpHost(),'',$this->signer->sign($this->generateFragmentUri($uri,$request,true)));
8485
}
8586

8687
// We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.

‎src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testRenderWithControllerAndSigner()
3838
{
3939
$strategy =newHIncludeFragmentRenderer(null,newUriSigner('foo'));
4040

41-
$this->assertEquals('<hx:include src="/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller&amp;_hash=5RZ1IkwF487EaXt6buHka73CCtQ%3D"></hx:include>',$strategy->render(newControllerReference('main_controller',array(),array()), Request::create('/'))->getContent());
41+
$this->assertEquals('<hx:include src="/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller&amp;_hash=g4b3vtCnhkZBFKrciEFwG7fucVo%3D"></hx:include>',$strategy->render(newControllerReference('main_controller',array(),array()), Request::create('/'))->getContent());
4242
}
4343

4444
publicfunctiontestRenderWithUri()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp