Permalink
Browse files

fix(views): do not output empty string titles in page/elements/title

  • Loading branch information...
jdalsem committed Mar 23, 2016
1 parent b92fca0 commit 41eecbe37d2c54d290b8f96cf8187db2a151d3b5
Showing with 7 additions and 5 deletions.
  1. +7 −5 views/default/page/elements/title.php
@@ -6,13 +6,15 @@
* @uses $vars['class'] Optional class for heading
*/
-if (!isset($vars['title'])) {
+$title = elgg_extract('title', $vars);
+if (!is_string($title) || $title === '') {
return;
}
-$class= '';
-if (isset($vars['class'])) {
- $class = " class=\"{$vars['class']}\"";
+$attributes = [];
+$class = elgg_extract('class', $vars);
+if (!empty($class)) {
+ $attributes['class'] = $class;
}
-echo "<h2{$class}>{$vars['title']}</h2>";
+echo elgg_format_element('h2', $attributes, $title);

0 comments on commit 41eecbe

Please sign in to comment.