Commit 05531bb5 authored by David Lesieur's avatar David Lesieur

Allow category labels to contain HTML.

parent a9496fb5
......@@ -133,10 +133,10 @@ class cck_facet extends faceted_search_facet {
function get_label() {
$field = content_fields($this->_field_name);
if (isset($field['widget']['label'])) {
return $field['widget']['label'];
return check_plain($field['widget']['label']);
}
else {
return $this->_field_name;
return check_plain($this->_field_name);
}
}
......@@ -266,9 +266,21 @@ class cck_facet_category extends faceted_search_category {
/**
* Return the label of this category.
*
* @param $html
* TRUE when HTML is allowed in the label, FALSE otherwise. Checking this
* flag allows implementors to provide a rich-text label if desired, and an
* alternate plain text version for cases where HTML cannot be used. The
* implementor is responsible to ensure adequate security filtering.
*/
function get_label() {
return $this->_label;
function get_label($html = FALSE) {
// Note: Label is already filtered by the CCK formatter.
if ($html) {
return $this->_label;
}
else {
return strip_tags($this->_label);
}
}
/**
......
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