Commit 584907e1 authored by alexpott's avatar alexpott

Issue #2422039 by idebr: Double escaping in search result info

parent 7f6f61f4
......@@ -59,6 +59,10 @@ function template_preprocess_search_result(&$variables) {
$variables['snippet'] = isset($result['snippet']) ? $result['snippet'] : '';
// Provide separated and grouped meta information..
$variables['info_split'] = $info;
$variables['info'] = implode(' - ', $info);
$variables['info'] = array(
'#type' => 'inline_template',
'#template' => '{{ info|safe_join(" - ") }}',
'#context' => array('info' => $info),
);
}
......@@ -26,7 +26,7 @@ protected function setUp() {
node_access_rebuild();
// Create a test user and log in.
$this->testUser = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search'));
$this->testUser = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search', 'access user profiles'));
$this->drupalLogin($this->testUser);
}
......@@ -47,5 +47,9 @@ function testPhraseSearchPunctuation() {
$edit = array('keys' => '"bunny\'s"');
$this->drupalPostForm('search/node', $edit, t('Search'));
$this->assertText($node->label());
// Check if the author is linked correctly to the user profile page.
$username = $node->getOwner()->getUsername();
$this->assertLink($username);
}
}
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