Commit 5cbb82bb authored by webchick's avatar webchick

Issue #2267763 by pwolanin, tim.plunkett: Page titles with %placeholders are...

Issue #2267763 by pwolanin, tim.plunkett: Page titles with %placeholders are broken when used as breadcrumbs.
parent 9b584232
......@@ -15,7 +15,13 @@
interface TitleResolverInterface {
/**
* Returns the title from a static or dynamic title for the route.
* Returns a static or dynamic title for the route.
*
* The returned title string must be safe to output in HTML. For example, an
* implementation should call \Drupal\Component\Utility\String::checkPlain()
* or \Drupal\Component\Utility\Xss::filterAdmin() on the string, or use
* appropriate placeholders to sanitize dynamic content inside a localized
* string before returning it. The title may contain HTML such as EM tags.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The request object passed to the title callback.
......
......@@ -150,7 +150,7 @@ public function build(array $attributes) {
}
// @todo Replace with a #type => link render element so that the alter
// hook can work with the actual data.
$links[] = $this->l($title, $route_request->attributes->get(RouteObjectInterface::ROUTE_NAME), $route_request->attributes->get('_raw_variables')->all());
$links[] = $this->l($title, $route_request->attributes->get(RouteObjectInterface::ROUTE_NAME), $route_request->attributes->get('_raw_variables')->all(), array('html' => TRUE));
}
}
......
......@@ -190,7 +190,7 @@ public function testBuildWithTwoPathElements() {
$link_front = '<a href="/">Home</a>';
$this->linkGenerator->expects($this->at(0))
->method('generate')
->with('Example', 'example', array(), array())
->with('Example', 'example', array(), array('html' => TRUE))
->will($this->returnValue($link_example));
$this->linkGenerator->expects($this->at(1))
->method('generate')
......@@ -241,12 +241,12 @@ public function testBuildWithThreePathElements() {
$link_front = '<a href="/">Home</a>';
$this->linkGenerator->expects($this->at(0))
->method('generate')
->with('Bar', 'example_bar', array(), array())
->with('Bar', 'example_bar', array(), array('html' => TRUE))
->will($this->returnValue($link_example_bar));
$this->linkGenerator->expects($this->at(1))
->method('generate')
->with('Example', 'example', array(), array())
->with('Example', 'example', array(), array('html' => TRUE))
->will($this->returnValue($link_example));
$this->linkGenerator->expects($this->at(2))
->method('generate')
......@@ -364,7 +364,7 @@ public function testBuildWithUserPath() {
$link_front = '<a href="/">Home</a>';
$this->linkGenerator->expects($this->at(0))
->method('generate')
->with('Admin', 'user_page', array(), array())
->with('Admin', 'user_page', array(), array('html' => TRUE))
->will($this->returnValue($link_user));
$this->linkGenerator->expects($this->at(1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment