diff options
Diffstat (limited to 'mod/search')
-rw-r--r-- | mod/search/README.txt | 5 | ||||
-rw-r--r-- | mod/search/manifest.xml | 2 | ||||
-rw-r--r-- | mod/search/pages/search/index.php | 7 | ||||
-rw-r--r-- | mod/search/start.php | 6 | ||||
-rw-r--r-- | mod/search/views/default/search/search_box.php | 7 | ||||
-rw-r--r-- | mod/search/views/rss/search/list.php (renamed from mod/search/views/rss/search/listing.php) | 0 |
6 files changed, 17 insertions, 10 deletions
diff --git a/mod/search/README.txt b/mod/search/README.txt index 63b490e28..98a002dd5 100644 --- a/mod/search/README.txt +++ b/mod/search/README.txt @@ -44,11 +44,6 @@ by saying in your plugin's init function: register_entity_type($type, $subtype); -If you are extending ElggObject with your own class, it is also advised -to add a subtype in your plugin's run_once function by saying: - - add_subtype($type, $subtype, $class); - If your plugin uses ElggEntity's standard title and description, and you don't need a custom display, there is nothing else you need to do for your results to appear in search. If you would like more diff --git a/mod/search/manifest.xml b/mod/search/manifest.xml index 9a952d3d8..513d3a6b9 100644 --- a/mod/search/manifest.xml +++ b/mod/search/manifest.xml @@ -7,7 +7,7 @@ <description>Allow search across entities of the site</description> <website>http://www.elgg.org/</website> <copyright>See COPYRIGHT.txt</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> <type>elgg_release</type> <version>1.8</version> diff --git a/mod/search/pages/search/index.php b/mod/search/pages/search/index.php index c4e8d2219..efa3ec037 100644 --- a/mod/search/pages/search/index.php +++ b/mod/search/pages/search/index.php @@ -19,7 +19,12 @@ $query = stripslashes(get_input('q', get_input('tag', ''))); // @todo - create function for sanitization of strings for display in 1.8 // encode <,>,&, quotes and characters above 127 -$display_query = mb_convert_encoding($query, 'HTML-ENTITIES', 'UTF-8'); +if (function_exists('mb_convert_encoding')) { + $display_query = mb_convert_encoding($query, 'HTML-ENTITIES', 'UTF-8'); +} else { + // if no mbstring extension, we just strip characters + $display_query = preg_replace("/[^\x01-\x7F]/", "", $query); +} $display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false); // check that we have an actual query diff --git a/mod/search/start.php b/mod/search/start.php index 9ab14f42f..73a96dc0a 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -14,7 +14,7 @@ function search_init() { require_once 'search_hooks.php'; // page handler for search actions and results - elgg_register_page_handler('search','search_page_handler'); + elgg_register_page_handler('search', 'search_page_handler'); // register some default search hooks elgg_register_plugin_hook_handler('search', 'object', 'search_objects_hook'); @@ -55,7 +55,8 @@ function search_init() { /** * Page handler for search * - * @param array $page Page elements from pain page handler + * @param array $page Page elements from core page handler + * @return bool */ function search_page_handler($page) { @@ -71,6 +72,7 @@ function search_page_handler($page) { $base_dir = elgg_get_plugins_path() . 'search/pages/search'; include_once("$base_dir/index.php"); + return true; } /** diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php index 9440dd1de..87d59519c 100644 --- a/mod/search/views/default/search/search_box.php +++ b/mod/search/views/default/search/search_box.php @@ -24,7 +24,12 @@ $value = stripslashes($value); // @todo - create function for sanitization of strings for display in 1.8 // encode <,>,&, quotes and characters above 127 -$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8'); +if (function_exists('mb_convert_encoding')) { + $display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8'); +} else { + // if no mbstring extension, we just strip characters + $display_query = preg_replace("/[^\x01-\x7F]/", "", $value); +} $display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false); diff --git a/mod/search/views/rss/search/listing.php b/mod/search/views/rss/search/list.php index 32082fd31..32082fd31 100644 --- a/mod/search/views/rss/search/listing.php +++ b/mod/search/views/rss/search/list.php |