| punbb-1.2.6/upload/admin_groups.php |
punbb-1.2.7/upload/admin_groups.php |
| 243: } | 243: } |
| 244: else | 244: else |
| 245: { | 245: { |
| 246: $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()); | 246: $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()); |
| 247: if ($db->num_rows($result)) | 247: if ($db->num_rows($result)) |
| 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); | 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
| 249: | 249: |
| 250: $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()); | 250: $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()); |
| 251: } | 251: } |
| 252: | 252: |
| 253: // Regenerate the quickjump cache | 253: // Regenerate the quickjump cache |
| punbb-1.2.6/upload/admin_index.php |
punbb-1.2.7/upload/admin_index.php |
| 86: $load_averages = @explode(' ', $load_averages); | 86: $load_averages = @explode(' ', $load_averages); |
| 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; | 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; |
| 88: } | 88: } |
| 89: else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) | 89: 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)) |
| 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; | 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; |
| 91: else | 91: else |
| 92: $server_load = 'Not available'; | 92: $server_load = 'Not available'; |
| punbb-1.2.6/upload/admin_options.php |
punbb-1.2.7/upload/admin_options.php |
| 117: while (list($key, $input) = @each($form)) | 117: while (list($key, $input) = @each($form)) |
| 118: { | 118: { |
| 119: // Only update values that have changed | 119: // Only update values that have changed |
| 120: if (isset($pun_config['o_'.$key]) && $pun_config['o_'.$key] != $input) | 120: if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input) |
| 121: { | 121: { |
| 122: if ($input != '' || is_int($input)) | 122: if ($input != '' || is_int($input)) |
| 123: $value = '\''.$db->escape($input).'\''; | 123: $value = '\''.$db->escape($input).'\''; |
| punbb-1.2.6/upload/admin_permissions.php |
punbb-1.2.7/upload/admin_permissions.php |
| 39: { | 39: { |
| 40: confirm_referrer('admin_permissions.php'); | 40: confirm_referrer('admin_permissions.php'); |
| 41: | 41: |
| 42: $form = array_map('trim', $_POST['form']); | 42: $form = array_map('intval', $_POST['form']); |
| 43: | |
| 44: $form['sig_length'] = intval($form['sig_length']); | |
| 45: $form['sig_lines'] = intval($form['sig_lines']); | |
| 46: | 43: |
| 47: while (list($key, $input) = @each($form)) | 44: while (list($key, $input) = @each($form)) |
| 48: { | 45: { |
| 49: // Only update values that have changed | 46: // Only update values that have changed |
| 50: if (isset($pun_config['p_'.$key]) && $pun_config['p_'.$key] != $input) | 47: if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input) |
| 51: { | 48: $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()); |
| 52: if ($input != '' || is_int($input)) | |
| 53: $value = '\''.$db->escape($input).'\''; | |
| 54: else | |
| 55: $value = 'NULL'; | |
| 56: | |
| 57: $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()); | |
| 58: } | |
| 59: } | 49: } |
| 60: | 50: |
| 61: // Regenerate the config cache | 51: // Regenerate the config cache |
| punbb-1.2.6/upload/admin_users.php |
punbb-1.2.7/upload/admin_users.php |
| 217: | 217: |
| 218: // trim() all elements in $form | 218: // trim() all elements in $form |
| 219: $form = array_map('trim', $form); | 219: $form = array_map('trim', $form); |
| | 220: $conditions = array(); |
| 220: | 221: |
| 221: $posts_greater = trim($_POST['posts_greater']); | 222: $posts_greater = trim($_POST['posts_greater']); |
| 222: $posts_less = trim($_POST['posts_less']); | 223: $posts_less = trim($_POST['posts_less']); |
| 268: if ($user_group != 'all') | 269: if ($user_group != 'all') |
| 269: $conditions[] = 'u.group_id='.$db->escape($user_group); | 270: $conditions[] = 'u.group_id='.$db->escape($user_group); |
| 270: | 271: |
| 271: if (!isset($conditions)) | 272: if (empty($conditions)) |
| 272: message('You didn\'t enter any search terms.'); | 273: message('You didn\'t enter any search terms.'); |
| 273: | 274: |
| 274: | 275: |
| punbb-1.2.6/upload/edit.php |
punbb-1.2.7/upload/edit.php |
| 175: else if (isset($_POST['preview'])) | 175: else if (isset($_POST['preview'])) |
| 176: { | 176: { |
| 177: require_once PUN_ROOT.'include/parser.php'; | 177: require_once PUN_ROOT.'include/parser.php'; |
| 178: $message = parse_message(trim($_POST['req_message']), $hide_smilies); | 178: $preview_message = parse_message($message, $hide_smilies); |
| 179: | 179: |
| 180: ?> | 180: ?> |
| 181: <div id="postpreview" class="blockpost"> | 181: <div id="postpreview" class="blockpost"> |
| 184: <div class="inbox"> | 184: <div class="inbox"> |
| 185: <div class="postright"> | 185: <div class="postright"> |
| 186: <div class="postmsg"> | 186: <div class="postmsg"> |
| 187: <?php echo $message."\n" ?> | 187: <?php echo $preview_message."\n" ?> |
| 188: </div> | 188: </div> |
| 189: </div> | 189: </div> |
| 190: </div> | 190: </div> |
| 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> | 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> |
| 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> | 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> |
| 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> | 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> |
| 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $_POST['req_message'] : $cur_post['message']) ?></textarea><br /></label> | 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label> |
| 212: <ul class="bblinks"> | 212: <ul class="bblinks"> |
| 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| punbb-1.2.6/upload/extern.php |
punbb-1.2.7/upload/extern.php |
| 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); | 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); |
| 117: | 117: |
| 118: | 118: |
| 119: // Disable error reporting for uninitialized variables | 119: // Make sure PHP reports all errors except E_NOTICE |
| 120: error_reporting(E_ALL); | 120: error_reporting(E_ALL ^ E_NOTICE); |
| 121: | 121: |
| 122: // Turn off magic_quotes_runtime | 122: // Turn off magic_quotes_runtime |
| 123: set_magic_quotes_runtime(0); | 123: set_magic_quotes_runtime(0); |
| punbb-1.2.6/upload/include/functions.php |
punbb-1.2.7/upload/include/functions.php |
| 168: } | 168: } |
| 169: | 169: |
| 170: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) | 170: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) |
| | 171: { |
| | 172: $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()); |
| 171: 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'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 173: 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'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| | 174: } |
| 172: | 175: |
| 173: if ($cur_ban['ip'] != '') | 176: if ($cur_ban['ip'] != '') |
| 174: { | 177: { |
| 179: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; | 182: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; |
| 180: | 183: |
| 181: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) | 184: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) |
| | 185: { |
| | 186: $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()); |
| 182: 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'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 187: 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'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| | 188: } |
| 183: } | 189: } |
| 184: } | 190: } |
| 185: } | 191: } |
| punbb-1.2.6/upload/include/parser.php |
punbb-1.2.7/upload/include/parser.php |
| 264: { | 264: { |
| 265: global $pun_user; | 265: global $pun_user; |
| 266: | 266: |
| 267: $full_url = str_replace(' ', '%20', $url); | 267: $full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url); |
| 268: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// | 268: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// |
| 269: $full_url = 'http://'.$full_url; | 269: $full_url = 'http://'.$full_url; |
| 270: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// | 270: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// |
| 314: $pattern = array('#\[b\](.*?)\[/b\]#s', | 314: $pattern = array('#\[b\](.*?)\[/b\]#s', |
| 315: '#\[i\](.*?)\[/i\]#s', | 315: '#\[i\](.*?)\[/i\]#s', |
| 316: '#\[u\](.*?)\[/u\]#s', | 316: '#\[u\](.*?)\[/u\]#s', |
| 317: '#\[url\](.*?)\[/url\]#e', | 317: '#\[url\]([^\[]*?)\[/url\]#e', |
| 318: '#\[url=(.*?)\](.*?)\[/url\]#e', | 318: '#\[url=([^\[]*?)\](.*?)\[/url\]#e', |
| 319: '#\[email\](.*?)\[/email\]#', | 319: '#\[email\]([^\[]*?)\[/email\]#', |
| 320: '#\[email=(.*?)\](.*?)\[/email\]#', | 320: '#\[email=([^\[]*?)\](.*?)\[/email\]#', |
| 321: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); | 321: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); |
| 322: | 322: |
| 323: $replace = array('<strong>$1</strong>', | 323: $replace = array('<strong>$1</strong>', |
| punbb-1.2.6/upload/install.php |
punbb-1.2.7/upload/install.php |
| 24: | 24: |
| 25: | 25: |
| 26: // The PunBB version this script installs | 26: // The PunBB version this script installs |
| 27: $punbb_version = '1.2.6'; | 27: $punbb_version = '1.2.7'; |
| 28: | 28: |
| 29: | 29: |
| 30: define('PUN_ROOT', './'); | 30: define('PUN_ROOT', './'); |
| 528: break; | 528: break; |
| 529: } | 529: } |
| 530: | 530: |
| 531: $db->query($sql) or error('Unable to create table '.$db_prefix.'online. Please check your settings and try again.', __FILE__, __LINE__, $db->error()); | 531: $db->query($sql) or error('Unable to create table '.$db_prefix.'config. Please check your settings and try again.', __FILE__, __LINE__, $db->error()); |
| 532: | 532: |
| 533: | 533: |
| 534: | 534: |
| punbb-1.2.6/upload/post.php |
punbb-1.2.7/upload/post.php |
| 440: else if (isset($_POST['preview'])) | 440: else if (isset($_POST['preview'])) |
| 441: { | 441: { |
| 442: require_once PUN_ROOT.'include/parser.php'; | 442: require_once PUN_ROOT.'include/parser.php'; |
| 443: $message = parse_message($message, $hide_smilies); | 443: $preview_message = parse_message($message, $hide_smilies); |
| 444: | 444: |
| 445: ?> | 445: ?> |
| 446: <div id="postpreview" class="blockpost"> | 446: <div id="postpreview" class="blockpost"> |
| 449: <div class="inbox"> | 449: <div class="inbox"> |
| 450: <div class="postright"> | 450: <div class="postright"> |
| 451: <div class="postmsg"> | 451: <div class="postmsg"> |
| 452: <?php echo $message."\n" ?> | 452: <?php echo $preview_message."\n" ?> |
| 453: </div> | 453: </div> |
| 454: </div> | 454: </div> |
| 455: </div> | 455: </div> |
| 491: if ($fid): ?> | 491: if ($fid): ?> |
| 492: <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label> | 492: <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label> |
| 493: <?php endif; ?> <label><strong><?php echo $lang_common['Message'] ?></strong><br /> | 493: <?php endif; ?> <label><strong><?php echo $lang_common['Message'] ?></strong><br /> |
| 494: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars(trim($_POST['req_message'])) : (isset($quote) ? $quote : ''); ?></textarea><br /></label> | 494: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label> |
| 495: <ul class="bblinks"> | 495: <ul class="bblinks"> |
| 496: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 496: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| 497: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 497: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| punbb-1.2.6/upload/register.php |
punbb-1.2.7/upload/register.php |
| 171: $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1'; | 171: $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1'; |
| 172: | 172: |
| 173: $email_setting = intval($_POST['email_setting']); | 173: $email_setting = intval($_POST['email_setting']); |
| 174: if ($email_setting < 0 && $email_setting > 2) $email_setting = 1; | 174: if ($email_setting < 0 || $email_setting > 2) $email_setting = 1; |
| 175: | 175: |
| 176: // Insert the new user into the database. We do this now to get the last inserted id for later use. | 176: // Insert the new user into the database. We do this now to get the last inserted id for later use. |
| 177: $now = time(); | 177: $now = time(); |
| punbb-1.2.6/upload/search.php |
punbb-1.2.7/upload/search.php |
| 53: $sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC'; | 53: $sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC'; |
| 54: | 54: |
| 55: // If a search_id was supplied | 55: // If a search_id was supplied |
| 56: if (isset($_GET['search_id'])) | 56: if (isset($_REQUEST['search_id'])) |
| 57: { | 57: { |
| 58: $search_id = intval($_GET['search_id']); | 58: $search_id = intval($_GET['search_id']); |
| 59: if ($search_id < 1) | 59: if ($search_id < 1) |