Commit 5778af91 authored by alexpott's avatar alexpott

Issue #2011918 by Liam Morland, jesse.d, scor: Fixed Titles are often...

Issue #2011918 by Liam Morland, jesse.d, scor: Fixed Titles are often double-escaped (including in the content attribute of the dc:title meta element for nodes).
parent 120bbc97
......@@ -51,7 +51,12 @@ public function setUp() {
* Creates a node of type article and tests its RDFa markup.
*/
function testNodeAttributes() {
$node = $this->drupalCreateNode(array('type' => 'article'));
// Create node with single quotation mark title to ensure it does not get
// escaped more than once.
$node = $this->drupalCreateNode(array(
'type' => 'article',
'title' => $this->randomName(8) . "'",
));
$node_uri = url('node/' . $node->id(), array('absolute' => TRUE));
$base_uri = url('<front>', array('absolute' => TRUE));
......
......@@ -260,7 +260,7 @@ function rdf_preprocess_node(&$variables) {
$title_mapping = $mapping->getPreparedFieldMapping('title');
if ($title_mapping) {
$title_attributes['property'] = empty($title_mapping['properties']) ? NULL : $title_mapping['properties'];
$title_attributes['content'] = $variables['label'];
$title_attributes['content'] = $variables['node']->label();
$variables['title_suffix']['rdf_meta_title'] = array(
'#theme' => 'rdf_metadata',
'#metadata' => array($title_attributes),
......
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