// clean the text if needed
$text = $this->cleanText($text,$this->cfg['stripOutput']);
// get the extract
$text = $this->getExtract($text,$this->searchString,$this->advSearch,HIGHLIGHT_CLASS,$nbExtr);
function addExtractToRow($row)
// get the extract
$text = $this->getExtract($text,$this->searchString,$this->advSearch,HIGHLIGHT_CLASS,$nbExtr);
// clean the text if needed
$text = $this->cleanText($text,$this->cfg['stripOutput']);
function addExtractToRow($row){
$text = '';
$nbExtr = 0;
if ($this->extractNb) {
// From row get all the fields allowed to use for extract
foreach($this->extractFields as $f) if($row[$f]) $text .= $row[$f] . ' ';
// clean the text if needed
$text = $this->cleanText($text,$this->cfg['stripOutput']);
// get the extract
$text = $this->getExtract($text,$this->searchString,$this->advSearch,HIGHLIGHT_CLASS,$nbExtr);
// html_entity encoding
$text = htmlentities($text,ENT_QUOTES,'UTF-8');
}
$row['extract'] = $text; // set the concatened extracts
return $row;
}&c<span class="ajaxSearch_highlight ajaxSearch_highlight4">op</span>y;
)I tried a little bit and found that storing raw chars for é, á, ç and so on is not a big problem, even € and © work fine but the often used & and < give problems... and there are maybe more...
I’m not sure but probably all five predefined xml character entity’s ( &, <, >, " and ’ ) give problems..
Entity Encoding
This option controls how entities/characters gets processed by TinyMCE. The value can be set to numeric, named or raw. Where numeric is numeric representation such as " " named is entity names such as "& " and raw is " ". The default value of this option is named, if named is used the entities option will be used to convert the codes into names.
Encoding types:
named
Characters will be converted into named entities based on the entities option. For example, a non-breaking space could be encoded as .
numeric
Characters will be converted into numeric entities. For example, a non-breaking space would be encoded as &160;.
raw
All characters will be stored in non entity form except these XML root entities: & = < > " ’
Thank you for reminding me of this, but I don’t see how this could help me...
Entity Encoding
This option controls how entities/characters gets processed by TinyMCE. <cut>
function StripOutput($text){
if ($text !== ''){
// replace line breaking tags with whitespace
$text = stripLineBreaking($text);
// strip modx sensitive tags
$text = stripTags($text);
// strip Jscripts
$text = stripJscripts($text);
// strip html tags. Tags should be correctly ended
$text = stripHTML($text);
// html_entity encoding
$text = htmlentities($text,ENT_QUOTES,'UTF-8');
}
return $text;
}<p>Zoek & ' ' © één één Curaçao kun je zoekéén ></p>
<div class="ajaxSearch_resultExtract"><p>...<span class="ajaxSearch_highlight ajaxSearch_highlight1">Zoek</span> & ' ' © één één Curaçao kun je <span class="ajaxSearch_highlight ajaxSearch_highlight1">zoek</span>éé...</p></div>
&<span class="ajaxSearch_highlight ajaxSearch_highlight1">amp</span>;
Again I was to quick with my conclusions, the problem is solved in the search results, but not in the linked pages.
OK (I think) I finally solved both problems...
&<span class="ajaxSearch_highlight ajaxSearch_highlight1">amp</span>;