diff -urN punbb-1.2.6/upload/admin_groups.php punbb-1.2.12/upload/admin_groups.php
--- punbb-1.2.6/upload/admin_groups.php Thu Jul 7 19:31:54 2005
+++ punbb-1.2.12/upload/admin_groups.php Fri Sep 2 16:04:40 2005
@@ -243,11 +243,11 @@
}
else
{
- $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.$_POST['group_id']) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
+ $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.');
- $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());
+ $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error());
}
// Regenerate the quickjump cache
diff -urN punbb-1.2.6/upload/admin_index.php punbb-1.2.12/upload/admin_index.php
--- punbb-1.2.6/upload/admin_index.php Sun Mar 20 20:13:24 2005
+++ punbb-1.2.12/upload/admin_index.php Fri Sep 2 16:03:18 2005
@@ -86,7 +86,7 @@
$load_averages = @explode(' ', $load_averages);
$server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available';
}
-else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))
+else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))
$server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3];
else
$server_load = 'Not available';
diff -urN punbb-1.2.6/upload/admin_options.php punbb-1.2.12/upload/admin_options.php
--- punbb-1.2.6/upload/admin_options.php Thu Jul 7 19:31:54 2005
+++ punbb-1.2.12/upload/admin_options.php Wed Jul 27 23:24:24 2005
@@ -117,7 +117,7 @@
while (list($key, $input) = @each($form))
{
// Only update values that have changed
- if (isset($pun_config['o_'.$key]) && $pun_config['o_'.$key] != $input)
+ if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input)
{
if ($input != '' || is_int($input))
$value = '\''.$db->escape($input).'\'';
diff -urN punbb-1.2.6/upload/admin_permissions.php punbb-1.2.12/upload/admin_permissions.php
--- punbb-1.2.6/upload/admin_permissions.php Thu Jul 7 19:31:54 2005
+++ punbb-1.2.12/upload/admin_permissions.php Fri Sep 2 01:36:10 2005
@@ -39,23 +39,13 @@
{
confirm_referrer('admin_permissions.php');
- $form = array_map('trim', $_POST['form']);
-
- $form['sig_length'] = intval($form['sig_length']);
- $form['sig_lines'] = intval($form['sig_lines']);
+ $form = array_map('intval', $_POST['form']);
while (list($key, $input) = @each($form))
{
// Only update values that have changed
- if (isset($pun_config['p_'.$key]) && $pun_config['p_'.$key] != $input)
- {
- if ($input != '' || is_int($input))
- $value = '\''.$db->escape($input).'\'';
- else
- $value = 'NULL';
-
- $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'p_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
- }
+ if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
+ $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
}
// Regenerate the config cache
diff -urN punbb-1.2.6/upload/admin_users.php punbb-1.2.12/upload/admin_users.php
--- punbb-1.2.6/upload/admin_users.php Thu Jul 7 19:31:54 2005
+++ punbb-1.2.12/upload/admin_users.php Fri Sep 2 16:04:40 2005
@@ -217,6 +217,7 @@
// trim() all elements in $form
$form = array_map('trim', $form);
+ $conditions = array();
$posts_greater = trim($_POST['posts_greater']);
$posts_less = trim($_POST['posts_less']);
@@ -268,7 +269,7 @@
if ($user_group != 'all')
$conditions[] = 'u.group_id='.$db->escape($user_group);
- if (!isset($conditions))
+ if (empty($conditions))
message('You didn\'t enter any search terms.');
diff -urN punbb-1.2.6/upload/edit.php punbb-1.2.12/upload/edit.php
--- punbb-1.2.6/upload/edit.php Tue Jan 11 21:41:14 2005
+++ punbb-1.2.12/upload/edit.php Fri Sep 2 16:05:30 2005
@@ -175,7 +175,7 @@
else if (isset($_POST['preview']))
{
require_once PUN_ROOT.'include/parser.php';
- $message = parse_message(trim($_POST['req_message']), $hide_smilies);
+ $preview_message = parse_message($message, $hide_smilies);
?>
@@ -184,7 +184,7 @@
@@ -208,7 +208,7 @@
-
+
:
:
diff -urN punbb-1.2.6/upload/extern.php punbb-1.2.12/upload/extern.php
--- punbb-1.2.6/upload/extern.php Thu Jul 7 21:36:06 2005
+++ punbb-1.2.12/upload/extern.php Wed Jul 27 23:25:14 2005
@@ -116,8 +116,8 @@
exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');
-// Disable error reporting for uninitialized variables
-error_reporting(E_ALL);
+// Make sure PHP reports all errors except E_NOTICE
+error_reporting(E_ALL ^ E_NOTICE);
// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);
diff -urN punbb-1.2.6/upload/header.php punbb-1.2.12/upload/header.php
--- punbb-1.2.6/upload/header.php Thu Jul 7 18:48:00 2005
+++ punbb-1.2.12/upload/header.php Tue Feb 28 20:20:26 2006
@@ -131,7 +131,7 @@
// START SUBST -
-$tpl_main = str_replace('', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main);
+$tpl_main = str_replace('', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main);
// END SUBST -
diff -urN punbb-1.2.6/upload/include/common.php punbb-1.2.12/upload/include/common.php
--- punbb-1.2.6/upload/include/common.php Thu Jul 7 19:38:16 2005
+++ punbb-1.2.12/upload/include/common.php Tue Nov 1 01:06:54 2005
@@ -32,6 +32,15 @@
if (!defined('PUN_ROOT'))
exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');
+
+// Load the functions script
+require PUN_ROOT.'include/functions.php';
+
+// Reverse the effect of register_globals
+if (@ini_get('register_globals'))
+ unregister_globals();
+
+
@include PUN_ROOT.'config.php';
// If PUN isn't defined, config.php is missing or corrupt
@@ -76,9 +85,6 @@
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);
-
-// Load the functions script
-require PUN_ROOT.'include/functions.php';
// Load DB abstraction layer and connect
require PUN_ROOT.'include/dblayer/common_db.php';
diff -urN punbb-1.2.6/upload/include/email.php punbb-1.2.12/upload/include/email.php
--- punbb-1.2.6/upload/include/email.php Thu Apr 7 21:41:16 2005
+++ punbb-1.2.12/upload/include/email.php Thu Sep 22 00:35:04 2005
@@ -75,15 +75,7 @@
$subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
$from = trim(preg_replace('#[\n\r:]+#s', '', $from));
- // Detect what linebreak we should use for the headers
- if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN'))
- $eol = "\r\n";
- else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC'))
- $eol = "\r";
- else
- $eol = "\n";
-
- $headers = 'From: '.$from.$eol.'Date: '.date('r').$eol.'MIME-Version: 1.0'.$eol.'Content-transfer-encoding: 8bit'.$eol.'Content-type: text/plain; charset='.$lang_common['lang_encoding'].$eol.'X-Mailer: PunBB Mailer';
+ $headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer';
// Make sure all linebreaks are CRLF in message
$message = str_replace("\n", "\r\n", pun_linebreaks($message));
@@ -91,7 +83,15 @@
if ($pun_config['o_smtp_host'] != '')
smtp_mail($to, $subject, $message, $headers);
else
+ {
+ // Change the linebreaks used in the headers according to OS
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC')
+ $headers = str_replace("\r\n", "\r", $headers);
+ else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
+ $headers = str_replace("\r\n", "\n", $headers);
+
mail($to, $subject, $message, $headers);
+ }
}
diff -urN punbb-1.2.6/upload/include/functions.php punbb-1.2.12/upload/include/functions.php
--- punbb-1.2.6/upload/include/functions.php Fri Jul 8 20:10:57 2005
+++ punbb-1.2.12/upload/include/functions.php Tue Nov 1 01:10:48 2005
@@ -168,7 +168,10 @@
}
if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))
+ {
+ $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].''.pun_htmlspecialchars($cur_ban['message']).' ' : ' ').$lang_common['Ban message 4'].' '.$pun_config['o_admin_email'].' .', true);
+ }
if ($cur_ban['ip'] != '')
{
@@ -179,7 +182,10 @@
$cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])
+ {
+ $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].''.pun_htmlspecialchars($cur_ban['message']).' ' : ' ').$lang_common['Ban message 4'].' '.$pun_config['o_admin_email'].' .', true);
+ }
}
}
}
@@ -203,7 +209,7 @@
$now = time();
// Fetch all online list entries that are older than "o_timeout_online"
- $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
+ $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to fetch old entries from online list', __FILE__, __LINE__, $db->error());
while ($cur_user = $db->fetch_assoc($result))
{
// If the entry is a guest, delete it
@@ -675,28 +681,7 @@
//
function get_remote_address()
{
- $remote_address = $_SERVER['REMOTE_ADDR'];
-
- // If HTTP_X_FORWARDED_FOR is set, we try to grab the first non-LAN IP
- if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
- {
- if (preg_match_all('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_SERVER['HTTP_X_FORWARDED_FOR'], $address_list))
- {
- $lan_ips = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
- $address_list = preg_replace($lan_ips, null, $address_list[0]);
-
- while (list(, $cur_address) = each($address_list))
- {
- if ($cur_address)
- {
- $remote_address = $cur_address;
- break;
- }
- }
- }
- }
-
- return $remote_address;
+ return $_SERVER['REMOTE_ADDR'];
}
@@ -1040,6 +1025,28 @@
$v)
+ {
+ if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
+ unset($GLOBALS[$k]);
+ }
}
diff -urN punbb-1.2.6/upload/include/parser.php punbb-1.2.12/upload/include/parser.php
--- punbb-1.2.6/upload/include/parser.php Thu Jul 7 22:00:42 2005
+++ punbb-1.2.12/upload/include/parser.php Sat May 20 17:42:32 2006
@@ -264,7 +264,7 @@
{
global $pun_user;
- $full_url = str_replace(' ', '%20', $url);
+ $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
$full_url = 'http://'.$full_url;
else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp://
@@ -314,10 +314,10 @@
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
- '#\[url\](.*?)\[/url\]#e',
- '#\[url=(.*?)\](.*?)\[/url\]#e',
- '#\[email\](.*?)\[/email\]#',
- '#\[email=(.*?)\](.*?)\[/email\]#',
+ '#\[url\]([^\[]*?)\[/url\]#e',
+ '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
+ '#\[email\]([^\[]*?)\[/email\]#',
+ '#\[email=([^\[]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
$replace = array('$1 ',
diff -urN punbb-1.2.6/upload/include/search_idx.php punbb-1.2.12/upload/include/search_idx.php
--- punbb-1.2.6/upload/include/search_idx.php Thu Jul 7 22:11:26 2005
+++ punbb-1.2.12/upload/include/search_idx.php Mon Oct 31 23:37:18 2005
@@ -69,10 +69,8 @@
{
while (list($i, $word) = @each($words))
{
+ $words[$i] = trim($word, '.');
$num_chars = pun_strlen($word);
-
- if (strrpos($word, '.') == ($num_chars-1))
- $words[$i] = substr($word, 0, -1);
if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
unset($words[$i]);
diff -urN punbb-1.2.6/upload/install.php punbb-1.2.12/upload/install.php
--- punbb-1.2.6/upload/install.php Thu Jul 7 22:43:44 2005
+++ punbb-1.2.12/upload/install.php Sat May 20 17:57:04 2006
@@ -24,7 +24,7 @@
// The PunBB version this script installs
-$punbb_version = '1.2.6';
+$punbb_version = '1.2.12';
define('PUN_ROOT', './');
@@ -528,7 +528,7 @@
break;
}
- $db->query($sql) or error('Unable to create table '.$db_prefix.'online. Please check your settings and try again.', __FILE__, __LINE__, $db->error());
+ $db->query($sql) or error('Unable to create table '.$db_prefix.'config. Please check your settings and try again.', __FILE__, __LINE__, $db->error());
diff -urN punbb-1.2.6/upload/login.php punbb-1.2.12/upload/login.php
--- punbb-1.2.6/upload/login.php Thu Jul 7 19:35:30 2005
+++ punbb-1.2.12/upload/login.php Sat May 20 17:52:02 2006
@@ -78,7 +78,7 @@
$expire = ($save_pass == '1') ? time() + 31536000 : 0;
pun_setcookie($user_id, $form_password_hash, $expire);
- redirect($_POST['redirect_url'], $lang_login['Login redirect']);
+ redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
}
@@ -153,7 +153,7 @@
message($lang_login['Forget mail'].' '.$pun_config['o_admin_email'].' .');
}
else
- message($lang_login['No e-mail match'].' '.$email.'.');
+ message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
}
diff -urN punbb-1.2.6/upload/misc.php punbb-1.2.12/upload/misc.php
--- punbb-1.2.6/upload/misc.php Sun Jul 3 13:54:30 2005
+++ punbb-1.2.12/upload/misc.php Sat May 20 17:52:02 2006
@@ -120,7 +120,7 @@
pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');
- redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);
+ redirect(htmlspecialchars($_POST['redirect_url']), $lang_misc['E-mail sent redirect']);
}
diff -urN punbb-1.2.6/upload/post.php punbb-1.2.12/upload/post.php
--- punbb-1.2.6/upload/post.php Wed May 4 21:52:38 2005
+++ punbb-1.2.12/upload/post.php Mon Oct 31 23:26:12 2005
@@ -338,7 +338,7 @@
if ($qid < 1)
message($lang_common['Bad request']);
- $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());
+ $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
@@ -440,7 +440,7 @@
else if (isset($_POST['preview']))
{
require_once PUN_ROOT.'include/parser.php';
- $message = parse_message($message, $hide_smilies);
+ $preview_message = parse_message($message, $hide_smilies);
?>
@@ -449,7 +449,7 @@
@@ -491,7 +491,7 @@
if ($fid): ?>
-
+
:
:
diff -urN punbb-1.2.6/upload/profile.php punbb-1.2.12/upload/profile.php
--- punbb-1.2.6/upload/profile.php Thu Jul 7 22:37:30 2005
+++ punbb-1.2.12/upload/profile.php Tue Nov 1 01:27:28 2005
@@ -201,6 +201,9 @@
}
else if (isset($_POST['form_sent']))
{
+ if (pun_hash($_POST['req_password']) !== $pun_user['password'])
+ message($lang_profile['Wrong pass']);
+
require PUN_ROOT.'include/email.php';
// Validate the email-address
@@ -264,7 +267,7 @@
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
- $required_fields = array('req_new_email' => $lang_profile['New e-mail']);
+ $required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
$focus_element = array('change_email', 'req_new_email');
require PUN_ROOT.'header.php';
@@ -279,6 +282,7 @@
@@ -362,12 +366,17 @@
message($lang_profile['Move failed'].' '.$pun_config['o_admin_email'].' .');
// Now check the width/height
- list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+ list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
{
@unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
}
+ else if ($type == 1 && $uploaded_file['type'] != 'image/gif') // Prevent dodgy uploads
+ {
+ @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+ message($lang_profile['Bad type']);
+ }
// Delete any old avatars and put the new one in place
@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
@@ -708,6 +717,14 @@
$form['email'] = strtolower(trim($_POST['req_email']));
if (!is_valid_email($form['email']))
message($lang_common['Invalid e-mail']);
+ }
+
+ // Make sure we got a valid language string
+ if (isset($form['language']))
+ {
+ $form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']);
+ if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php'))
+ message($lang_common['Bad request']);
}
break;
diff -urN punbb-1.2.6/upload/register.php punbb-1.2.12/upload/register.php
--- punbb-1.2.6/upload/register.php Thu May 5 00:26:04 2005
+++ punbb-1.2.12/upload/register.php Tue Feb 28 20:21:40 2006
@@ -79,6 +79,13 @@
else if (isset($_POST['form_sent']))
{
+ // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
+ $result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+
+ if ($db->num_rows($result))
+ message('A new user was registered with the same IP address as you within the last hour. To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.');
+
+
$username = pun_trim($_POST['req_username']);
$email1 = strtolower(trim($_POST['req_email1']));
@@ -171,7 +178,7 @@
$save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
$email_setting = intval($_POST['email_setting']);
- if ($email_setting < 0 && $email_setting > 2) $email_setting = 1;
+ if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
// Insert the new user into the database. We do this now to get the last inserted id for later use.
$now = time();
diff -urN punbb-1.2.6/upload/search.php punbb-1.2.12/upload/search.php
--- punbb-1.2.6/upload/search.php Thu Jul 7 18:58:46 2005
+++ punbb-1.2.12/upload/search.php Sun Oct 16 11:48:28 2005
@@ -51,6 +51,7 @@
$action = (isset($_GET['action'])) ? $_GET['action'] : null;
$forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1;
$sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC';
+ if (isset($search_id)) unset($search_id);
// If a search_id was supplied
if (isset($_GET['search_id']))
@@ -386,6 +387,7 @@
// Prune "old" search results
+ $old_searches = array();
$result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
diff -urN punbb-1.2.6/upload/userlist.php punbb-1.2.12/upload/userlist.php
--- punbb-1.2.6/upload/userlist.php Thu Mar 3 02:08:18 2005
+++ punbb-1.2.12/upload/userlist.php Sat May 20 17:53:28 2006
@@ -116,7 +116,7 @@
$where_sql[] = 'u.group_id='.$show_group;
// Fetch user count
-$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE u.id>1 AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);
diff -urN punbb-1.2.6/upload/viewforum.php punbb-1.2.12/upload/viewforum.php
--- punbb-1.2.6/upload/viewforum.php Tue Feb 1 17:16:46 2005
+++ punbb-1.2.12/upload/viewforum.php Thu Sep 22 00:39:30 2005
@@ -242,7 +242,7 @@