0) { foreach ($glossary_data as $glossary_index => $glossary_value) { $glossary_all_data[] = $glossary_value['id'].'__|__|'.$glossary_value['name']; } $description = implode('[|.|_|.|-|.|]', $glossary_all_data); } } elseif (isset($_POST['glossary_name'])) { $glossaryName = Security::remove_XSS($_POST['glossary_name']); $glossaryName = api_convert_encoding($glossaryName, $charset, 'UTF-8'); $glossaryName = trim($glossaryName); if (api_get_configuration_value('save_titles_as_html')) { $glossaryName = "%$glossaryName%"; } $glossaryInfo = GlossaryManager::get_glossary_term_by_glossary_name($glossaryName); if (!empty($glossaryInfo)) { $description = str_replace( $path_image_search, $path_image, $glossaryInfo['description'] ); if (is_null($description) || strlen(trim($description)) == 0) { $description = get_lang('No results found'); } else { $description = str_replace('class="glossary"', '', $description); } } } echo api_xml_http_response_encode($description);