aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_users.html4
-rw-r--r--phpBB/includes/functions_content.php38
-rw-r--r--phpBB/includes/functions_messenger.php16
-rw-r--r--phpBB/viewtopic.php2
4 files changed, 35 insertions, 25 deletions
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html
index 2e4b3ef8f2..34e4147356 100644
--- a/phpBB/adm/style/acp_users.html
+++ b/phpBB/adm/style/acp_users.html
@@ -197,7 +197,7 @@
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
</div>
<!-- ENDIF -->
-
+
<fieldset class="quick">
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
<p class="small"><a href="#" onclick="marklist('user_attachments', 'mark', true);">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('user_attachments', 'mark', false);">{L_UNMARK_ALL}</a></p>
@@ -215,7 +215,7 @@
<form id="select_forum" method="post" action="{U_ACTION}">
<fieldset class="quick" style="text-align: left;">
- {L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
+ {L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
<input class="button2" type="submit" value="{L_GO}" name="select" />
{S_FORM_TOKEN}
</fieldset>
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index d9c07182a5..3a8c53f365 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'] = '<select name="' . $name . '" id="' . $name . '">';
foreach ($sort_ary['options'] as $option => $text)
{
- $selected = ($sort_ary['selected']== $option) ? ' selected="selected"' : '';
- $sort_ary['output'] .= '<option value="' . $option . '"' . $selected . '>' . $text . '</option>';
+ $sort_ary['output'] .= '<option value="' . $option . '"' . (($selected == $option) ? ' selected="selected"' : '') . '>' . $text . '</option>';
}
$sort_ary['output'] .= '</select>';
- $u_sort_param .= ($sort_ary['selected'] !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&amp;' : '') . "{$name}={$sort_ary['selected']}" : '';
+
+ $u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&amp;' : '') . "{$name}={$selected}" : '';
}
return;
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 0666275181..de8b031b68 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, "<?php\n\$this->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-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $md5_challenge, $matches))
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index a0b32b2def..307a8c0854 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -181,7 +181,7 @@ $sql_array = array(
'FROM' => 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';