Revision | e9d8b6939d29f8f820ea6b7edb7c22e50a419085 (tree) |
---|---|
Time | 2022-03-22 00:30:32 |
Author | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/746 search2: Zenkaku space as search keywords delimiter
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // search2.inc.php |
4 | -// Copyright 2017-2021 PukiWiki Development Team | |
4 | +// Copyright 2017-2022 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Search2 plugin - Show detail result using JavaScript |
@@ -41,9 +41,14 @@ function plugin_search2_action() | ||
41 | 41 | 'body' => "<br>" . $_msg_searching . "\n" . |
42 | 42 | plugin_search2_search_form($q, $bases, $offset)); |
43 | 43 | } else { |
44 | - $msg = str_replace('$1', htmlsc($q), $_title_result); | |
44 | + $q2 = $q; | |
45 | + if (defined('PKWK_UTF8_ENABLE')) { | |
46 | + $zen_space = "\xE3\x80\x80"; // IDEOGRAPHIC SPACE in UTF-8 -   | |
47 | + $q2 = str_replace($zen_space, ' ', $q); | |
48 | + } | |
49 | + $msg = str_replace('$1', htmlsc($q2), $_title_result); | |
45 | 50 | return array('msg' => $msg, |
46 | - 'body' => plugin_search2_search_form($q, $bases, $offset, $prev_offset_s)); | |
51 | + 'body' => plugin_search2_search_form($q2, $bases, $offset, $prev_offset_s)); | |
47 | 52 | } |
48 | 53 | } else if ($action === 'query') { |
49 | 54 | $q = isset($vars['q']) ? $vars['q'] : ''; |