X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsearch.php;h=aa7ff0b367f70d0ca978f17c09f2384c9c117a6e;hb=f1d482ae999183d90b9a81e2d8e26397451799d7;hp=a5765d712d92651586673c37553b87a8c524c60b;hpb=a6d3eff675f7ace3d69f6d9788489ca930333315;p=squirrelmail.git diff --git a/src/search.php b/src/search.php index a5765d71..aa7ff0b3 100644 --- a/src/search.php +++ b/src/search.php @@ -3,18 +3,17 @@ /** * search.php * - * Copyright (c) 1999-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * IMAP search page * * Subfolder search idea from Patch #806075 by Thomas Pohl xraven at users.sourceforge.net. Thanks Thomas! * + * @author Alex Lemaresquier - Brainstorm + * @copyright © 1999-2006 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage search * @link http://www.ietf.org/rfc/rfc3501.txt - * @author Alex Lemaresquier - Brainstorm - alex at brainstorm.fr */ /** @@ -25,7 +24,7 @@ define('SM_PATH','../'); /** SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); +include_once(SM_PATH . 'include/validate.php'); include_once(SM_PATH . 'functions/strings.php'); include_once(SM_PATH . 'functions/imap_asearch.php'); include_once(SM_PATH . 'functions/imap_mailbox.php'); @@ -80,7 +79,9 @@ function asearch_get_link(&$href, $text, $title = '') */ function asearch_get_toggle_link($value, $action, $text_array, $title_array = array()) { - return asearch_get_link(asearch_get_href($action . '=' . (int)$value), $text_array[$value], asearch_nz($title_array[$value])); + $asearch_nz=asearch_nz($title_array[$value]); + $asearch_get_href=asearch_get_href($action . '=' . (int)$value); + return asearch_get_link($asearch_get_href, $text_array[$value], $asearch_nz); } /** @@ -506,7 +507,7 @@ function asearch_get_query_display(&$color, &$mailbox_array, &$biop_array, &$uno $cur_mailbox = 'INBOX'; $biop = asearch_nz($biop_array[$crit_num]); if (($query_display == '') || ($cur_mailbox != $last_mailbox)) { - $mailbox_display = ' ' . asearch_get_mailbox_display($cur_mailbox) . ''; + $mailbox_display = ' ' . htmlspecialchars(asearch_get_mailbox_display($cur_mailbox)) . ''; if ($query_display == '') $biop_display = _("In"); else @@ -657,7 +658,7 @@ function asearch_print_saved(&$boxes) if (isset($saved_array[$saved_prefkeys[0]])) { $saved_count = count($saved_array[$saved_prefkeys[0]]); if ($saved_count > 0) { - $saved_actions = array('edit_saved' => _("edit"), 'search_saved' => _("search"), 'delete_saved' => _("delete")); + $saved_actions = array('edit_saved' => _("Edit"), 'search_saved' => _("Search"), 'delete_saved' => _("Delete")); asearch_print_query_array($boxes, $saved_array, $saved_prefkeys, $saved_actions, _("Saved Searches"), 'search_show_saved'); } } @@ -715,7 +716,7 @@ function asearch_mailbox_exists($mailbox, &$boxes) function asearch_get_form_mailbox($imapConnection, &$boxes, $mailbox, $row_num = 0) { if (($mailbox != 'All Folders') && (!asearch_mailbox_exists($mailbox, $boxes))) { - $missing = asearch_opt($mailbox, $mailbox, '[' . _("Missing") . '] ' . asearch_get_mailbox_display($mailbox)); + $missing = asearch_opt($mailbox, $mailbox, '[' . _("Missing") . '] ' . htmlspecialchars(asearch_get_mailbox_display($mailbox))); } else { $missing = ''; } @@ -730,8 +731,7 @@ function asearch_get_form_mailbox($imapConnection, &$boxes, $mailbox, $row_num = */ function asearch_get_form_sub($sub, $row_num = 0) { - return function_exists('addCheckBox') ? addCheckBox('sub[' . $row_num .']', $sub) - : ''; + return addCheckBox('sub[' . $row_num .']', $sub); } /** Build the 2 unop and where selects @@ -748,16 +748,14 @@ function asearch_get_form_location($unop, $where, $row_num = 0) */ function asearch_get_form_what($what, $row_num = 0) { - return function_exists('addInput') ? addInput('what[' . $row_num . ']', $what, '35') - : ''; + return addInput('what[' . $row_num . ']', $what, '35'); } /** Build the Exclude criteria checkbox */ function asearch_get_form_exclude($exclude, $row_num = 0) { - return function_exists('addCheckBox') ? addCheckBox('exclude['.$row_num.']', $exclude) - : ''; + return addCheckBox('exclude['.$row_num.']', $exclude); } /** Print one advanced form row @@ -1359,7 +1357,7 @@ if (isset($aMailbox['FORWARD_SESSION'])) { session_write_close(); // restart the session. Do not use sqsession_is_active because the session_id // isn't empty after a session_write_close - session_start(); + sqsession_start(); if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) { $compose_width = '640'; @@ -1624,7 +1622,7 @@ if ($submit == $search_button_text) { $mailbox_display = imap_utf7_decode_local($mbx); } - echo '
' . _("Folder:") . ' '. $mailbox_display . ' '; + echo '
' . _("Folder:") . ' '. htmlspecialchars($mailbox_display) . ' '; $oTemplate->display('message_list.tpl'); } @@ -1643,7 +1641,7 @@ if ($submit == $search_button_text) { do_hook('search_bottom'); sqimap_logout($imapConnection); -echo ''; +$oTemplate->display('footer.tpl'); sqsession_register($mailbox_cache,'mailbox_cache'); -?> \ No newline at end of file +?>