mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
Fix #1622 : Sanitize captions display
This commit is contained in:
@@ -354,7 +354,7 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
}
|
||||
|
||||
// ---------------- new code ----------------------
|
||||
$cleanvalue = str_replace(array("<em>", "</em>", "'"), array("", "", "'"), $value);
|
||||
$cleanvalue = str_replace(array("[[em]]", "[[/em]]", "'"), array("", "", "'"), $value);
|
||||
|
||||
list($term_noacc, $context_noacc) = $this->splitTermAndContext($cleanvalue);
|
||||
$term_noacc = $this->app['unicode']->remove_indexer_chars($term_noacc);
|
||||
@@ -388,21 +388,10 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
}
|
||||
if($bestnode)
|
||||
{
|
||||
list($term, $context) = $this->splitTermAndContext($value);
|
||||
$term = str_replace(array("<em>", "</em>"), array("", ""), $term);
|
||||
$context = str_replace(array("<em>", "</em>"), array("", ""), $context);
|
||||
$qjs = $term;
|
||||
if ($context) {
|
||||
$qjs .= " [" . $context . "]";
|
||||
}
|
||||
list($term, $context) = $this->splitTermAndContext(str_replace(array("[[em]]", "[[/em]]"), array("", ""), $value));
|
||||
$qjs = $term . ($context ? '['.$context.']' : '');
|
||||
|
||||
$value = "<a class=\"bounce\" onclick=\"bounce('" . $databox->get_sbas_id() . "','"
|
||||
. str_replace("'", "\'", $qjs)
|
||||
. "', '"
|
||||
. str_replace("'", "\'", $this->databox_field->get_name())
|
||||
. "');return(false);\">"
|
||||
. $bestnode->getAttribute('v')
|
||||
. "</a>";
|
||||
$value = new ThesaurusValue($bestnode->getAttribute('v'), $this->databox_field, $qjs);
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
Reference in New Issue
Block a user