diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-04-07 11:40:38 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-04-07 11:40:38 -0400 |
commit | 770788d98eb9dfca51e6299e023edab26765c0bf (patch) | |
tree | 17817163962b9c8aaea7dfdbc3cc2ed3cdd7b774 /lib | |
parent | 4cc6d0ea2c7bec551c7726d7a336afea17d27df8 (diff) | |
parent | 17fb51f747c023392cd6127abe9b019e693f0544 (diff) |
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/searchaction.php | 23 | ||||
-rw-r--r-- | lib/util.php | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/lib/searchaction.php b/lib/searchaction.php index c762db16f..918f8dd9a 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -133,5 +133,28 @@ class SearchAction extends Action $this->showResults($q, $page); } } + + function searchSuggestions($q) { + $qe = urlencode($q); + $message = sprintf(_(<<<E_O_T +* Make sure all words are spelled correctly. +* Try different keywords. +* Try more general keywords. +* Try fewer keywords. + +You can also try your search on other engines: + +* [Twingly](http://www.twingly.com/search?q=%s&content=microblog&site=identi.ca) +* [Tweet scan](http://www.tweetscan.com/indexi.php?s=%s) +* [Google](http://www.google.com/search?q=site%%3A%%%%site.server%%%%+%s) +* [Yahoo](http://search.yahoo.com/search?p=site%%3A%%%%site.server%%%%+%s) + + +E_O_T +), $qe, $qe, $qe, $qe); + $this->elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } } diff --git a/lib/util.php b/lib/util.php index 73410e289..b17a44bd8 100644 --- a/lib/util.php +++ b/lib/util.php @@ -581,10 +581,8 @@ function common_shorten_link($url, $reverse = false) function common_xml_safe_str($str) { - $xmlStr = htmlentities(iconv('UTF-8', 'UTF-8//IGNORE', $str), ENT_NOQUOTES, 'UTF-8'); - - // Replace control, formatting, and surrogate characters with '*', ala Twitter - return preg_replace('/[\p{Cc}\p{Cf}\p{Cs}]/u', '*', $str); + // Neutralize control codes and surrogates + return preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str); } function common_tag_link($tag) |