Browse Source

Fix encoding issues with accented characters

The 'highlight' method of SearchNoticeListItem (noticesearch.php) messes
up the encoding of results sometimes so override showResults() and use a
regular NoticeList instead of SearchNoticeList.

FIXME: We should fix the underlying issue with the highlight() method.

Ref. #2
master
Chimo 1 year ago
parent
commit
6c3b940bab
No known key found for this signature in database GPG Key ID: D910B384C7E3B5EC
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      actions/enoticesearch.php

+ 23
- 0
actions/enoticesearch.php View File

@@ -138,5 +138,28 @@ class EnoticesearchAction extends NoticesearchAction
{
// pass
}

// The 'highlight' method of SearchNoticeListItem (noticesearch.php) messes up
// the encoding of results sometimes (see issue #2) so this is a copy of
// showResults() that uses a regular NoticeList instead of SearchNoticeList
// FIXME: We should fix the underlying issue with the highlight() method
function showResults($q, $page)
{
if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
if ($this->notice->N === 0) {
$this->showEmptyResults($q, $page);
} else {
$terms = preg_split('/[\s,]+/', $q);
$nl = new NoticeList($this->notice, $this, $terms); //
$cnt = $nl->show();
$this->pagination($page > 1,
$cnt > NOTICES_PER_PAGE,
$page,
'noticesearch',
array('q' => $q));
}
Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
}
}
}


Loading…
Cancel
Save