From 7a15bd9af31390e8894e4217369a8ff02a1bb283 Mon Sep 17 00:00:00 2001 From: acydburn Date: Mon, 6 Oct 2008 05:52:49 +0000 Subject: [PATCH] merge r8970 and r8971 git-svn-id: http://code.phpbb.com/svn/phpbb/trunk@8972 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_users.html | 4 ++-- phpBB/includes/functions_content.php | 38 +++++++++++++++++++++------------- phpBB/includes/functions_messenger.php | 16 +++++++------- phpBB/viewtopic.php | 2 +- 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 2e4b3ef8f..34e414735 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -197,7 +197,7 @@ {S_ON_PAGE}{PAGINATION} - +

{L_MARK_ALL}{L_UNMARK_ALL}

@@ -215,7 +215,7 @@
- {L_SELECT_FORUM}: + {L_SELECT_FORUM}: {S_FORM_TOKEN}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index d9c07182a..3a8c53f36 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -49,47 +49,57 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, $sorts = array( 'st' => array( - 'selected' => $sort_days, + 'key' => 'sort_days', 'default' => $def_st, 'options' => $limit_days, - 'output' => &$s_limit_days,), + 'output' => &$s_limit_days, + ), + 'sk' => array( - 'selected' => $sort_key, + 'key' => 'sort_key', 'default' => $def_sk, 'options' => $sort_by_text, - 'output' => &$s_sort_key,), + 'output' => &$s_sort_key, + ), + 'sd' => array( - 'selected' => $sort_dir, + 'key' => 'sort_dir', 'default' => $def_sd, 'options' => $sort_dir_text, - 'output' => &$s_sort_dir,), + 'output' => &$s_sort_dir, + ), ); $u_sort_param = ''; + foreach ($sorts as $name => $sort_ary) { + $key = $sort_ary['key']; + $selected = $$sort_ary['key']; + // Check if the key is selectable. If not, we reset to the default or first key found. - // This ensures the values are always valid. - if (!isset($sort_ary['options'][$sort_ary['selected']])) + // This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the + // correct value, else the protection is void. ;) + if (!isset($sort_ary['options'][$selected])) { if ($sort_ary['default'] !== false) { - $sort_ary['selected'] = $sort_ary['default']; + $selected = $$key = $sort_ary['default']; } else { @reset($sort_ary['options']); - $sort_ary['selected'] = key($sort_ary['options']); + $selected = $$key = key($sort_ary['options']); } } - + $sort_ary['output'] = ''; - $u_sort_param .= ($sort_ary['selected'] !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&' : '') . "{$name}={$sort_ary['selected']}" : ''; + + $u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&' : '') . "{$name}={$selected}" : ''; } return; diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 066627518..de8b031b6 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -681,14 +681,14 @@ class queue break; } } - + if (!sizeof($this->queue_data)) { @unlink($this->cache_file); } else { - if ($fp = @fopen($this->cache_file, 'w')) + if ($fp = @fopen($this->cache_file, 'wb')) { @flock($fp, LOCK_EX); fwrite($fp, "queue_data = " . var_export($this->queue_data, true) . ";\n?>"); @@ -711,11 +711,11 @@ class queue { return; } - + if (file_exists($this->cache_file)) { include($this->cache_file); - + foreach ($this->queue_data as $object => $data_ary) { if (isset($this->data[$object]) && sizeof($this->data[$object])) @@ -1045,7 +1045,7 @@ class smtp_class $err_msg .= $message; } } - + /** * Log into server and get possible auth codes if neccessary */ @@ -1106,7 +1106,7 @@ class smtp_class return false; } - // If EHLO fails, we try HELO + // If EHLO fails, we try HELO $this->server_send("HELO {$local_host}"); if ($err_msg = $this->server_parse('250', __LINE__)) { @@ -1127,7 +1127,7 @@ class smtp_class { return false; } - + if (!isset($this->commands['AUTH'])) { return (isset($user->lang['SMTP_NO_AUTH_SUPPORT'])) ? $user->lang['SMTP_NO_AUTH_SUPPORT'] : 'SMTP server does not support authentication'; @@ -1288,7 +1288,7 @@ class smtp_class } $md5_challenge = base64_decode($this->responses[0]); - + // Parse the md5 challenge - from AUTH_SASL (PEAR) $tokens = array(); while (preg_match('/^([a-z-]+)=("[^"]+(? array(FORUMS_TABLE => 'f'), ); -// The FROM-Order is quite important here, else t.* columns can not be correctly bound. +// The FROM-Order is quite important here, else t.* columns can not be correctly bound. if ($post_id) { $sql_array['FROM'][POSTS_TABLE] = 'p'; -- 2.11.4.GIT