PunBB 1.2.5 to 1.2.14 changes Legend
Lines removed 
Lines changed
 Lines added

punbb-1.2.5/upload/admin_bans.php punbb-1.2.14/upload/admin_bans.php
 44:         if (isset($_GET['add_ban'])) 44:         if (isset($_GET['add_ban']))
 45:         { 45:         {
 46:             $add_ban = intval($_GET['add_ban']); 46:             $add_ban = intval($_GET['add_ban']);
 47:             if ($add_ban < 1) 47:             if ($add_ban < 2)
 48:                 message($lang_common['Bad request']); 48:                 message($lang_common['Bad request']);
 49:  49: 
 50:             $user_id = $add_ban; 50:             $user_id = $add_ban;
 61:  61: 
 62:             if ($ban_user != '') 62:             if ($ban_user != '')
 63:             { 63:             {
 64:                 $result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); 64:                 $result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
 65:                 if ($db->num_rows($result)) 65:                 if ($db->num_rows($result))
 66:                     list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result); 66:                     list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result);
 67:                 else 67:                 else
192: 192: 
193:     if ($ban_user == '' && $ban_ip == '' && $ban_email == '')193:     if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
194:         message('You must enter either a username, an IP address or an e-mail address (at least).');194:         message('You must enter either a username, an IP address or an e-mail address (at least).');
 195:     else if (strtolower($ban_user) == 'guest')
 196:         message('The guest user cannot be banned.');
195: 197: 
196:     // Validate IP/IP range (it's overkill, I know)198:     // Validate IP/IP range (it's overkill, I know)
197:     if ($ban_ip != '')199:     if ($ban_ip != '')
244:     if ($_POST['mode'] == 'add')246:     if ($_POST['mode'] == 'add')
245:         $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());247:         $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
246:     else248:     else
247:         $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.$_POST['ban_id']) or error('Unable to update ban', __FILE__, __LINE__, $db->error());249:         $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error());
248: 250: 
249:     // Regenerate the bans cache251:     // Regenerate the bans cache
250:     require_once PUN_ROOT.'include/cache.php';252:     require_once PUN_ROOT.'include/cache.php';


punbb-1.2.5/upload/admin_forums.php punbb-1.2.14/upload/admin_forums.php
140:         if (!preg_match('#^\d+$#', $disp_position))140:         if (!preg_match('#^\d+$#', $disp_position))
141:             message('Position must be a positive integer value.');141:             message('Position must be a positive integer value.');
142: 142: 
143:         $db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.$forum_id) or error('Unable to update forum', __FILE__, __LINE__, $db->error());143:         $db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.intval($forum_id)) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
144:     }144:     }
145: 145: 
146:     // Regenerate the quickjump cache146:     // Regenerate the quickjump cache
186:             $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());186:             $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
187:             while ($cur_group = $db->fetch_assoc($result))187:             while ($cur_group = $db->fetch_assoc($result))
188:             {188:             {
189:                 $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']];189:                 $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? '1' : '0' : intval($_POST['read_forum_old'][$cur_group['g_id']]);
190:                 $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0';190:                 $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? '1' : '0';
191:                 $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0';191:                 $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? '1' : '0';
192: 192: 
193:                 // Check if the new settings differ from the old193:                 // Check if the new settings differ from the old
194:                 if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']])194:                 if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']])


punbb-1.2.5/upload/admin_groups.php punbb-1.2.14/upload/admin_groups.php
209: 209: 
210:     $title = trim($_POST['req_title']);210:     $title = trim($_POST['req_title']);
211:     $user_title = trim($_POST['user_title']);211:     $user_title = trim($_POST['user_title']);
212:     $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1';212:     $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1';
213:     $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1';213:     $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1';
214:     $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1';214:     $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1';
215:     $edit_posts = isset($_POST['edit_posts']) ? $_POST['edit_posts'] : ($is_admin_group) ? '1' : '0';215:     $edit_posts = isset($_POST['edit_posts']) ? intval($_POST['edit_posts']) : ($is_admin_group) ? '1' : '0';
216:     $delete_posts = isset($_POST['delete_posts']) ? $_POST['delete_posts'] : ($is_admin_group) ? '1' : '0';216:     $delete_posts = isset($_POST['delete_posts']) ? intval($_POST['delete_posts']) : ($is_admin_group) ? '1' : '0';
217:     $delete_topics = isset($_POST['delete_topics']) ? $_POST['delete_topics'] : ($is_admin_group) ? '1' : '0';217:     $delete_topics = isset($_POST['delete_topics']) ? intval($_POST['delete_topics']) : ($is_admin_group) ? '1' : '0';
218:     $set_title = isset($_POST['set_title']) ? $_POST['set_title'] : ($is_admin_group) ? '1' : '0';218:     $set_title = isset($_POST['set_title']) ? intval($_POST['set_title']) : ($is_admin_group) ? '1' : '0';
219:     $search = isset($_POST['search']) ? $_POST['search'] : '1';219:     $search = isset($_POST['search']) ? intval($_POST['search']) : '1';
220:     $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1';220:     $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1';
221:     $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0';221:     $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0';
222:     $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';222:     $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';
223:     $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';223:     $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';
243:     }243:     }
244:     else244:     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 cache253:     // Regenerate the quickjump cache
264:     confirm_referrer('admin_groups.php');264:     confirm_referrer('admin_groups.php');
265: 265: 
266:     $group_id = intval($_POST['default_group']);266:     $group_id = intval($_POST['default_group']);
267:     if ($group_id < 1)267:     if ($group_id < 4)
268:         message($lang_common['Bad request']);268:         message($lang_common['Bad request']);
269: 269: 
270:     $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());270:     $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());


punbb-1.2.5/upload/admin_index.php punbb-1.2.14/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.5/upload/admin_options.php punbb-1.2.14/upload/admin_options.php
 46:     if ($form['board_title'] == '') 46:     if ($form['board_title'] == '')
 47:         message('You must enter a board title.'); 47:         message('You must enter a board title.');
 48:  48: 
  49:     // Clean default_lang
  50:     $form['default_lang'] = preg_replace('#[\.\\\/]#', '', $form['default_lang']);
  51: 
 49:     require PUN_ROOT.'include/email.php'; 52:     require PUN_ROOT.'include/email.php';
 50:  53: 
 51:     $form['admin_email'] = strtolower($form['admin_email']); 54:     $form['admin_email'] = strtolower($form['admin_email']);
 63:     if (substr($form['base_url'], -1) == '/') 66:     if (substr($form['base_url'], -1) == '/')
 64:         $form['base_url'] = substr($form['base_url'], 0, -1); 67:         $form['base_url'] = substr($form['base_url'], 0, -1);
 65:  68: 
  69:     // Clean avatars_dir
  70:     $form['avatars_dir'] = str_replace("\0", '', $form['avatars_dir']);
  71: 
 66:     // Make sure avatars_dir doesn't end with a slash 72:     // Make sure avatars_dir doesn't end with a slash
 67:     if (substr($form['avatars_dir'], -1) == '/') 73:     if (substr($form['avatars_dir'], -1) == '/')
 68:         $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); 74:         $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1);
117:     while (list($key, $input) = @each($form))123:     while (list($key, $input) = @each($form))
118:     {124:     {
119:         // Only update values that have changed125:         // Only update values that have changed
120:         if ($pun_config['o_'.$key] != $input)126:         if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input)
121:         {127:         {
122:             if ($input != '' || is_int($input))128:             if ($input != '' || is_int($input))
123:                 $value = '\''.$db->escape($input).'\'';129:                 $value = '\''.$db->escape($input).'\'';
124:             else130:             else
125:                 $value = 'NULL';131:                 $value = 'NULL';
126: 132: 
127:             $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());133:             $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
128:         }134:         }
129:     }135:     }
130: 136: 
229:         $d = dir(PUN_ROOT.'lang');235:         $d = dir(PUN_ROOT.'lang');
230:         while (($entry = $d->read()) !== false)236:         while (($entry = $d->read()) !== false)
231:         {237:         {
232:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))238:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
233:                 $languages[] = $entry;239:                 $languages[] = $entry;
234:         }240:         }
235:         $d->close();241:         $d->close();
236: 242: 
 243:         @natsort($languages);
 244: 
237:         while (list(, $temp) = @each($languages))245:         while (list(, $temp) = @each($languages))
238:         {246:         {
239:             if ($pun_config['o_default_lang'] == $temp)247:             if ($pun_config['o_default_lang'] == $temp)
261:                 $styles[] = substr($entry, 0, strlen($entry)-4);269:                 $styles[] = substr($entry, 0, strlen($entry)-4);
262:         }270:         }
263:         $d->close();271:         $d->close();
 272: 
 273:         @natsort($styles);
264: 274: 
265:         while (list(, $temp) = @each($styles))275:         while (list(, $temp) = @each($styles))
266:         {276:         {


punbb-1.2.5/upload/admin_permissions.php punbb-1.2.14/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 ($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.5/upload/admin_prune.php punbb-1.2.14/upload/admin_prune.php
 62:         } 62:         }
 63:         else 63:         else
 64:         { 64:         {
  65:             $prune_from = intval($prune_from);
 65:             prune($prune_from, $_POST['prune_sticky'], $prune_date); 66:             prune($prune_from, $_POST['prune_sticky'], $prune_date);
 66:             update_forum($prune_from); 67:             update_forum($prune_from);
 67:         } 68:         }
 97:  98: 
 98:     if ($prune_from != 'all') 99:     if ($prune_from != 'all')
 99:     {100:     {
 101:         $prune_from = intval($prune_from);
100:         $sql .= ' AND forum_id='.$prune_from;102:         $sql .= ' AND forum_id='.$prune_from;
101: 103: 
102:         // Fetch the forum name (just for cosmetic reasons)104:         // Fetch the forum name (just for cosmetic reasons)


punbb-1.2.5/upload/admin_users.php punbb-1.2.14/upload/admin_users.php
217: 217: 
218:     // trim() all elements in $form218:     // 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']);
256:     $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';257:     $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
257:     while (list($key, $input) = @each($form))258:     while (list($key, $input) = @each($form))
258:     {259:     {
259:         if ($input != '')260:         if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
260:             $conditions[] = 'u.'.$key.' '.$like_command.' \''.str_replace('*', '%', $input).'\'';261:             $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
261:     }262:     }
262: 263: 
263:     if ($posts_greater != '')264:     if ($posts_greater != '')
266:         $conditions[] = 'u.num_posts<'.$posts_less;267:         $conditions[] = 'u.num_posts<'.$posts_less;
267: 268: 
268:     if ($user_group != 'all')269:     if ($user_group != 'all')
269:         $conditions[] = 'u.group_id='.$db->escape($user_group);270:         $conditions[] = 'u.group_id='.intval($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.5/upload/edit.php punbb-1.2.14/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.5/upload/extern.php punbb-1.2.14/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 variables119: // 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_runtime122: // Turn off magic_quotes_runtime
123: set_magic_quotes_runtime(0);123: set_magic_quotes_runtime(0);
129: // Load DB abstraction layer and try to connect129: // Load DB abstraction layer and try to connect
130: require PUN_ROOT.'include/dblayer/common_db.php';130: require PUN_ROOT.'include/dblayer/common_db.php';
131: 131: 
132: // Get the forum config132: // Load cached config
133: $result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());133: @include PUN_ROOT.'cache/cache_config.php';
134: while ($cur_config_item = $db->fetch_row($result))134: if (!defined('PUN_CONFIG_LOADED'))
135:     $pun_config[$cur_config_item[0]] = $cur_config_item[1];135: {
 136:     require PUN_ROOT.'include/cache.php';
 137:     generate_config_cache();
 138:     require PUN_ROOT.'cache/cache_config.php';
 139: }
136: 140: 
137: // Make sure we (guests) have permission to read the forums141: // Make sure we (guests) have permission to read the forums
138: $result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());142: $result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());


punbb-1.2.5/upload/footer.php punbb-1.2.14/upload/footer.php
140: 140: 
141: 141: 
142: // START SUBST - <pun_include "*">142: // START SUBST - <pun_include "*">
143: while (preg_match('/<pun_include "(.*?)">/', $tpl_main, $cur_include))143: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
144: {144: {
 145:     if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 146:         error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template main.tpl. There is no such file in folder /include/user/');
 147: 
145:     ob_start();148:     ob_start();
146:     include PUN_ROOT.$cur_include[1];149:     include PUN_ROOT.'include/user/'.$cur_include[1];
147:     $tpl_temp = ob_get_contents();150:     $tpl_temp = ob_get_contents();
148:     $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);151:     $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
149:     ob_end_clean();152:     ob_end_clean();


punbb-1.2.5/upload/header.php punbb-1.2.14/upload/header.php
 68: if (defined('PUN_ADMIN_CONSOLE')) 68: if (defined('PUN_ADMIN_CONSOLE'))
 69:     echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; 69:     echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n";
 70:  70: 
 71: if (isset($destination_url)) 71: if (isset($required_fields))
 72:     echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'" />'."\n"; 
 73:  
 74: else if (isset($required_fields)) 
 75: { 72: {
 76:     // Output JavaScript to validate form (make sure required fields are filled out) 73:     // Output JavaScript to validate form (make sure required fields are filled out)
 77:  74: 
134: 131: 
135: 132: 
136: // START SUBST - <pun_page>133: // START SUBST - <pun_page>
137: $tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main);134: $tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main);
138: // END SUBST - <pun_title>135: // END SUBST - <pun_title>
139: 136: 
140: 137: 


punbb-1.2.5/upload/include/cache.php punbb-1.2.14/upload/include/cache.php
129:     global $db;129:     global $db;
130: 130: 
131:     // Get the rank list from the DB131:     // Get the rank list from the DB
132:     $result = $db->query('SELECT * FROM '.$db->prefix.'ranks', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());132:     $result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
133: 133: 
134:     $output = array();134:     $output = array();
135:     while ($cur_rank = $db->fetch_assoc($result))135:     while ($cur_rank = $db->fetch_assoc($result))
174:         if (!$fh)174:         if (!$fh)
175:             error('Unable to write quickjump cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);175:             error('Unable to write quickjump cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
176: 176: 
177:         $output = '<?php'."\n\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';177:         $output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';
178:         $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";178:         $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
179: 179: 
180: 180: 


punbb-1.2.5/upload/include/common.php punbb-1.2.14/upload/include/common.php
 32: if (!defined('PUN_ROOT')) 32: if (!defined('PUN_ROOT'))
 33:     exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.'); 33:     exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');
 34:  34: 
  35: 
  36: // Load the functions script
  37: require PUN_ROOT.'include/functions.php';
  38: 
  39: // Reverse the effect of register_globals
  40: if (@ini_get('register_globals'))
  41:     unregister_globals();
  42: 
  43: 
 35: @include PUN_ROOT.'config.php'; 44: @include PUN_ROOT.'config.php';
 36:  45: 
 37: // If PUN isn't defined, config.php is missing or corrupt 46: // If PUN isn't defined, config.php is missing or corrupt
 43: list($usec, $sec) = explode(' ', microtime()); 52: list($usec, $sec) = explode(' ', microtime());
 44: $pun_start = ((float)$usec + (float)$sec); 53: $pun_start = ((float)$usec + (float)$sec);
 45:  54: 
 46: // Enable full error, warning and notice reporting 55: // Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not.
 47: error_reporting(E_ALL); 56: error_reporting(E_ALL ^ E_NOTICE);
 48:  57: 
 49: // Turn off magic_quotes_runtime 58: // Turn off magic_quotes_runtime
 50: set_magic_quotes_runtime(0); 59: set_magic_quotes_runtime(0);
 77: define('PUN_MEMBER', 4); 86: define('PUN_MEMBER', 4);
 78:  87: 
 79:  88: 
 80: // Load the functions script 
 81: require PUN_ROOT.'include/functions.php'; 
 82:  
 83: // Load DB abstraction layer and connect 89: // Load DB abstraction layer and connect
 84: require PUN_ROOT.'include/dblayer/common_db.php'; 90: require PUN_ROOT.'include/dblayer/common_db.php';
 85:  91: 
117: // Attempt to load the common language file123: // Attempt to load the common language file
118: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';124: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
119: if (!isset($lang_common))125: if (!isset($lang_common))
120:     exit('There is no valid language pack \''.$pun_user['language'].'\' installed. Please reinstall a language of that name.');126:     exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.');
121: 127: 
122: // Check if we are to display a maintenance message128: // Check if we are to display a maintenance message
123: if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))129: if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))


punbb-1.2.5/upload/include/email.php punbb-1.2.14/upload/include/email.php
 75:     $subject = trim(preg_replace('#[\n\r]+#s', '', $subject)); 75:     $subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
 76:     $from = trim(preg_replace('#[\n\r:]+#s', '', $from)); 76:     $from = trim(preg_replace('#[\n\r:]+#s', '', $from));
 77:  77: 
 78:     // Detect what linebreak we should use for the headers 78:     $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';
 79:     if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) 
 80:         $eol = "\r\n"; 
 81:     else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) 
 82:         $eol = "\r"; 
 83:     else 
 84:         $eol = "\n"; 
 85:  
 86:     $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'; 
 87:  79: 
 88:     // Make sure all linebreaks are CRLF in message 80:     // Make sure all linebreaks are CRLF in message
 89:     $message = str_replace("\n", "\r\n", pun_linebreaks($message)); 81:     $message = str_replace("\n", "\r\n", pun_linebreaks($message));
 91:     if ($pun_config['o_smtp_host'] != '') 83:     if ($pun_config['o_smtp_host'] != '')
 92:         smtp_mail($to, $subject, $message, $headers); 84:         smtp_mail($to, $subject, $message, $headers);
 93:     else 85:     else
  86:     {
  87:         // Change the linebreaks used in the headers according to OS
  88:         if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC')
  89:             $headers = str_replace("\r\n", "\r", $headers);
  90:         else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
  91:             $headers = str_replace("\r\n", "\n", $headers);
  92: 
 94:         mail($to, $subject, $message, $headers); 93:         mail($to, $subject, $message, $headers);
  94:     }
 95: } 95: }
 96:  96: 
 97:  97: 


punbb-1.2.5/upload/include/functions.php punbb-1.2.14/upload/include/functions.php
138:     // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)138:     // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)
139: //    @header('P3P: CP="CUR ADM"');139: //    @header('P3P: CP="CUR ADM"');
140: 140: 
141:     setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure);141:     if (version_compare(PHP_VERSION, '5.2.0', '>='))
 142:         setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
 143:     else
 144:         setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
142: }145: }
143: 146: 
144: 147: 
168:         }171:         }
169: 172: 
170:         if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))173:         if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))
 174:         {
 175:             $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);176:             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);
 177:         }
172: 178: 
173:         if ($cur_ban['ip'] != '')179:         if ($cur_ban['ip'] != '')
174:         {180:         {
179:                 $cur_ban_ips[$i] = $cur_ban_ips[$i].'.';185:                 $cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
180: 186: 
181:                 if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])187:                 if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])
 188:                 {
 189:                     $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);190:                     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);
 191:                 }
183:             }192:             }
184:         }193:         }
185:     }194:     }
203:     $now = time();212:     $now = time();
204: 213: 
205:     // Fetch all online list entries that are older than "o_timeout_online"214:     // Fetch all online list entries that are older than "o_timeout_online"
206:     $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());215:     $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());
207:     while ($cur_user = $db->fetch_assoc($result))216:     while ($cur_user = $db->fetch_assoc($result))
208:     {217:     {
209:         // If the entry is a guest, delete it218:         // If the entry is a guest, delete it
675: //684: //
676: function get_remote_address()685: function get_remote_address()
677: {686: {
678:     $remote_address = $_SERVER['REMOTE_ADDR'];687:     return $_SERVER['REMOTE_ADDR'];
679:  
680:     // If HTTP_X_FORWARDED_FOR is set, we try to grab the first non-LAN IP 
681:     if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) 
682:     { 
683:         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)) 
684:         { 
685:             $lan_ips = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/'); 
686:             $address_list = preg_replace($lan_ips, null, $address_list[0]); 
687:  
688:             while (list(, $cur_address) = each($address_list)) 
689:             { 
690:                 if ($cur_address) 
691:                 { 
692:                     $remote_address = $cur_address; 
693:                     break; 
694:                 } 
695:             } 
696:         } 
697:     } 
698:  
699:     return $remote_address; 
700: }688: }
701: 689: 
702: 690: 
803: 791: 
804: 792: 
805:     // START SUBST - <pun_include "*">793:     // START SUBST - <pun_include "*">
806:     while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include))794:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include))
807:     {795:     {
 796:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 797:             error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template maintenance.tpl. There is no such file in folder /include/user/');
 798: 
808:         ob_start();799:         ob_start();
809:         include PUN_ROOT.$cur_include[1];800:         include PUN_ROOT.'include/user/'.$cur_include[1];
810:         $tpl_temp = ob_get_contents();801:         $tpl_temp = ob_get_contents();
811:         $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint);802:         $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint);
812:         ob_end_clean();803:         ob_end_clean();
813:     }804:     }
814:     // END SUBST - <pun_include "*">805:     // END SUBST - <pun_include "*">
854:     ob_start();845:     ob_start();
855: 846: 
856: ?>847: ?>
857: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" />848: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) ?>" />
858: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>849: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>
859: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />850: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
860: <?php851: <?php
893: 884: 
894: 885: 
895:     // START SUBST - <pun_include "*">886:     // START SUBST - <pun_include "*">
896:     while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include))887:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_redir, $cur_include))
897:     {888:     {
 889:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 890:             error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template redirect.tpl. There is no such file in folder /include/user/');
 891: 
898:         ob_start();892:         ob_start();
899:         include PUN_ROOT.$cur_include[1];893:         include PUN_ROOT.'include/user/'.$cur_include[1];
900:         $tpl_temp = ob_get_contents();894:         $tpl_temp = ob_get_contents();
901:         $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir);895:         $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
902:         ob_end_clean();896:         ob_end_clean();
903:     }897:     }
904:     // END SUBST - <pun_include "*">898:     // END SUBST - <pun_include "*">
1034: </div>1028: </div>
1035: <?php1029: <?php
1036: 1030: 
 1031: }
 1032: 
 1033: 
 1034: //
 1035: // Unset any variables instantiated as a result of register_globals being enabled
 1036: //
 1037: function unregister_globals()
 1038: {
 1039:     // Prevent script.php?GLOBALS[foo]=bar
 1040:     if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
 1041:         exit('I\'ll have a steak sandwich and... a steak sandwich.');
 1042:     
 1043:     // Variables that shouldn't be unset
 1044:     $no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
 1045: 
 1046:     // Remove elements in $GLOBALS that are present in any of the superglobals
 1047:     $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
 1048:     foreach ($input as $k => $v)
 1049:     {
 1050:         if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
 1051:         {
 1052:             unset($GLOBALS[$k]);
 1053:             unset($GLOBALS[$k]);    // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
 1054:         }
 1055:     }
1037: }1056: }
1038: 1057: 
1039: 1058: 


punbb-1.2.5/upload/include/parser.php punbb-1.2.14/upload/include/parser.php
184:         {184:         {
185:             // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag185:             // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
186:             $tmp = strpos($text, '[/code]');186:             $tmp = strpos($text, '[/code]');
187:             $tmp2 = strpos(substr($text, 6), '[code]');187:             $tmp2 = strpos(substr($text, $c_start+6), '[code]');
 188:             if ($tmp2 !== false)
 189:                 $tmp2 += $c_start+6;
 190: 
188:             if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))191:             if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
189:             {192:             {
190:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];193:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
261: {264: {
262:     global $pun_user;265:     global $pun_user;
263: 266: 
264:     $full_url = str_replace(' ', '%20', $url);267:     $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
265:     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://
266:         $full_url = 'http://'.$full_url;269:         $full_url = 'http://'.$full_url;
267:     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://
301: {304: {
302:     global $lang_common, $pun_user;305:     global $lang_common, $pun_user;
303: 306: 
 307:     if (strpos($text, 'quote') !== false)
 308:     {
 309:         $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
 310:         $text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
 311:         $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
 312:     }
 313: 
304:     $pattern = array('#\[b\](.*?)\[/b\]#s',314:     $pattern = array('#\[b\](.*?)\[/b\]#s',
305:                      '#\[i\](.*?)\[/i\]#s',315:                      '#\[i\](.*?)\[/i\]#s',
306:                      '#\[u\](.*?)\[/u\]#s',316:                      '#\[u\](.*?)\[/u\]#s',
307:                      '#\[url\](.*?)\[/url\]#e',317:                      '#\[url\]([^\[]*?)\[/url\]#e',
308:                      '#\[url=(.*?)\](.*?)\[/url\]#e',318:                      '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
309:                      '#\[email\](.*?)\[/email\]#',319:                      '#\[email\]([^\[]*?)\[/email\]#',
310:                      '#\[email=(.*?)\](.*?)\[/email\]#',320:                      '#\[email=([^\[]*?)\](.*?)\[/email\]#',
311:                      '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');321:                      '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
312: 322: 
313:     $replace = array('<strong>$1</strong>',323:     $replace = array('<strong>$1</strong>',
321: 331: 
322:     // This thing takes a while! :)332:     // This thing takes a while! :)
323:     $text = preg_replace($pattern, $replace, $text);333:     $text = preg_replace($pattern, $replace, $text);
324:  
325:     if (strpos($text, 'quote') !== false) 
326:     { 
327:         $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); 
328:         $text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'&#91;\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); 
329:         $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); 
330:     } 
331: 334: 
332:     return $text;335:     return $text;
333: }336: }


punbb-1.2.5/upload/include/search_idx.php punbb-1.2.14/upload/include/search_idx.php
 43:  43: 
 44:     if (empty($noise_match)) 44:     if (empty($noise_match))
 45:     { 45:     {
 46:         $noise_match =         array('quote', 'code', 'url', 'img', 'email', 'color', 'colour', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); 46:         $noise_match =         array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*');
 47:         $noise_replace =    array('',      '',     '',    '',    '',      '',      '',       ' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ', ' ', ' '); 47:         $noise_replace =    array('',       '',      '',     '',     '',       '',       '',        '',       '',      '',     '',     '',       '',       '',        ' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ', ' ', ' ');
 48:  48: 
 49:         $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); 49:         $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt');
 50:         $stopwords = array_map('trim', $stopwords); 50:         $stopwords = array_map('trim', $stopwords);
 69:     { 69:     {
 70:         while (list($i, $word) = @each($words)) 70:         while (list($i, $word) = @each($words))
 71:         { 71:         {
  72:             $words[$i] = trim($word, '.');
 72:             $num_chars = pun_strlen($word); 73:             $num_chars = pun_strlen($word);
 73:  
 74:             if (strrpos($word, '.') == ($num_chars-1)) 
 75:                 $words[$i] = substr($word, 0, -1); 
 76:  74: 
 77:             if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords)) 75:             if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
 78:                 unset($words[$i]); 76:                 unset($words[$i]);


punbb-1.2.5/upload/install.php punbb-1.2.14/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.5'; 27: $punbb_version = '1.2.14';
 28:  28: 
 29:  29: 
 30: define('PUN_ROOT', './'); 30: define('PUN_ROOT', './');
165:                 <fieldset>165:                 <fieldset>
166:                     <legend>Enter then name of your database</legend>166:                     <legend>Enter then name of your database</legend>
167:                     <div class="infldset">167:                     <div class="infldset">
168:                         <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If it doesn't exists, PunBB will attempt to create it.</p>168:                         <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If the SQLite database file does not exist, PunBB will attempt to create it.</p>
169:                         <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label>169:                         <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label>
170:                     </div>170:                     </div>
171:                 </fieldset>171:                 </fieldset>
324:     if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))324:     if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
325:         error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.');325:         error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.');
326: 326: 
327:     if (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $email))327:     if (strlen($email) > 50 || !preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email))
328:         error('The administrator e-mail address you entered is invalid. Please go back and correct.');328:         error('The administrator e-mail address you entered is invalid. Please go back and correct.');
329: 329: 
330: 330: 
346:         case 'sqlite':346:         case 'sqlite':
347:             require PUN_ROOT.'include/dblayer/sqlite.php';347:             require PUN_ROOT.'include/dblayer/sqlite.php';
348:             break;348:             break;
 349: 
 350:         default:
 351:             error('\''.$db_type.'\' is not a valid database type.');
349:     }352:     }
350: 353: 
351:     // Create the database object (and connect/select db)354:     // Create the database object (and connect/select db)
525:             break;528:             break;
526:     }529:     }
527: 530: 
528:     $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());
529: 532: 
530: 533: 
531: 534: 
754:                     poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,757:                     poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
755:                     poster_ip VARCHAR(15),758:                     poster_ip VARCHAR(15),
756:                     poster_email VARCHAR(50),759:                     poster_email VARCHAR(50),
757:                     message TEXT NOT NULL DEFAULT '',760:                     message TEXT,
758:                     hide_smilies TINYINT(1) NOT NULL DEFAULT 0,761:                     hide_smilies TINYINT(1) NOT NULL DEFAULT 0,
759:                     posted INT(10) UNSIGNED NOT NULL DEFAULT 0,762:                     posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
760:                     edited INT(10) UNSIGNED,763:                     edited INT(10) UNSIGNED,
771:                     poster_id INT NOT NULL DEFAULT 1,774:                     poster_id INT NOT NULL DEFAULT 1,
772:                     poster_ip VARCHAR(15),775:                     poster_ip VARCHAR(15),
773:                     poster_email VARCHAR(50),776:                     poster_email VARCHAR(50),
774:                     message TEXT NOT NULL DEFAULT '',777:                     message TEXT,
775:                     hide_smilies SMALLINT NOT NULL DEFAULT 0,778:                     hide_smilies SMALLINT NOT NULL DEFAULT 0,
776:                     posted INT NOT NULL DEFAULT 0,779:                     posted INT NOT NULL DEFAULT 0,
777:                     edited INT,780:                     edited INT,
788:                     poster_id INTEGER NOT NULL DEFAULT 1,791:                     poster_id INTEGER NOT NULL DEFAULT 1,
789:                     poster_ip VARCHAR(15),792:                     poster_ip VARCHAR(15),
790:                     poster_email VARCHAR(50),793:                     poster_email VARCHAR(50),
791:                     message TEXT NOT NULL DEFAULT '',794:                     message TEXT,
792:                     hide_smilies INTEGER NOT NULL DEFAULT 0,795:                     hide_smilies INTEGER NOT NULL DEFAULT 0,
793:                     posted INTEGER NOT NULL DEFAULT 0,796:                     posted INTEGER NOT NULL DEFAULT 0,
794:                     edited INTEGER,797:                     edited INTEGER,
849:                     forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,852:                     forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
850:                     reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,853:                     reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,
851:                     created INT(10) UNSIGNED NOT NULL DEFAULT 0,854:                     created INT(10) UNSIGNED NOT NULL DEFAULT 0,
852:                     message TEXT NOT NULL DEFAULT '',855:                     message TEXT,
853:                     zapped INT(10) UNSIGNED,856:                     zapped INT(10) UNSIGNED,
854:                     zapped_by INT(10) UNSIGNED,857:                     zapped_by INT(10) UNSIGNED,
855:                     PRIMARY KEY (id)858:                     PRIMARY KEY (id)
864:                     forum_id INT NOT NULL DEFAULT 0,867:                     forum_id INT NOT NULL DEFAULT 0,
865:                     reported_by INT NOT NULL DEFAULT 0,868:                     reported_by INT NOT NULL DEFAULT 0,
866:                     created INT NOT NULL DEFAULT 0,869:                     created INT NOT NULL DEFAULT 0,
867:                     message TEXT NOT NULL DEFAULT '',870:                     message TEXT,
868:                     zapped INT,871:                     zapped INT,
869:                     zapped_by INT,872:                     zapped_by INT,
870:                     PRIMARY KEY (id)873:                     PRIMARY KEY (id)
879:                     forum_id INTEGER NOT NULL DEFAULT 0,882:                     forum_id INTEGER NOT NULL DEFAULT 0,
880:                     reported_by INTEGER NOT NULL DEFAULT 0,883:                     reported_by INTEGER NOT NULL DEFAULT 0,
881:                     created INTEGER NOT NULL DEFAULT 0,884:                     created INTEGER NOT NULL DEFAULT 0,
882:                     message TEXT NOT NULL DEFAULT '',885:                     message TEXT,
883:                     zapped INTEGER,886:                     zapped INTEGER,
884:                     zapped_by INTEGER,887:                     zapped_by INTEGER,
885:                     PRIMARY KEY (id)888:                     PRIMARY KEY (id)
898:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (901:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
899:                     id INT(10) UNSIGNED NOT NULL DEFAULT 0,902:                     id INT(10) UNSIGNED NOT NULL DEFAULT 0,
900:                     ident VARCHAR(200) NOT NULL DEFAULT '',903:                     ident VARCHAR(200) NOT NULL DEFAULT '',
901:                     search_data TEXT NOT NULL DEFAULT '',904:                     search_data TEXT,
902:                     PRIMARY KEY (id)905:                     PRIMARY KEY (id)
903:                     ) TYPE=MyISAM;";906:                     ) TYPE=MyISAM;";
904:             break;907:             break;
907:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (910:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
908:                     id INT NOT NULL DEFAULT 0,911:                     id INT NOT NULL DEFAULT 0,
909:                     ident VARCHAR(200) NOT NULL DEFAULT '',912:                     ident VARCHAR(200) NOT NULL DEFAULT '',
910:                     search_data TEXT NOT NULL DEFAULT '',913:                     search_data TEXT,
911:                     PRIMARY KEY (id)914:                     PRIMARY KEY (id)
912:                     )";915:                     )";
913:             break;916:             break;
916:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (919:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
917:                     id INTEGER NOT NULL DEFAULT 0,920:                     id INTEGER NOT NULL DEFAULT 0,
918:                     ident VARCHAR(200) NOT NULL DEFAULT '',921:                     ident VARCHAR(200) NOT NULL DEFAULT '',
919:                     search_data TEXT NOT NULL DEFAULT '',922:                     search_data TEXT,
920:                     PRIMARY KEY (id)923:                     PRIMARY KEY (id)
921:                     )";924:                     )";
922:             break;925:             break;
1420:         <div class="fakeform">1423:         <div class="fakeform">
1421:             <div class="inform">1424:             <div class="inform">
1422:                 <div class="forminfo">1425:                 <div class="forminfo">
1423:                     <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php and after ?&gt; in the file. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p>1426:                     <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p>
1424: <?php if ($alerts != ''): ?>                    <?php echo $alerts."\n" ?>1427: <?php if ($alerts != ''): ?>                    <?php echo $alerts."\n" ?>
1425: <?php endif; ?>                </div>1428: <?php endif; ?>                </div>
1426:                 <fieldset>1429:                 <fieldset>


punbb-1.2.5/upload/login.php punbb-1.2.14/upload/login.php
 78:     $expire = ($save_pass == '1') ? time() + 31536000 : 0; 78:     $expire = ($save_pass == '1') ? time() + 31536000 : 0;
 79:     pun_setcookie($user_id, $form_password_hash, $expire); 79:     pun_setcookie($user_id, $form_password_hash, $expire);
 80:  80: 
 81:     redirect($_POST['redirect_url'], $lang_login['Login redirect']); 81:     redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
 82: } 82: }
 83:  83: 
 84:  84: 
153:             message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');153:             message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
154:         }154:         }
155:         else155:         else
156:             message($lang_login['No e-mail match'].' '.$email.'.');156:             message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
157:     }157:     }
158: 158: 
159: 159: 
191:     header('Location: index.php');191:     header('Location: index.php');
192: 192: 
193: // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)193: // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
194: $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php';194: $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
195: 195: 
196: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];196: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];
197: $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);197: $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);


punbb-1.2.5/upload/misc.php punbb-1.2.14/upload/misc.php
 76:         message($lang_common['No permission']); 76:         message($lang_common['No permission']);
 77:  77: 
 78:     $recipient_id = intval($_GET['email']); 78:     $recipient_id = intval($_GET['email']);
 79:     if ($recipient_id < 1) 79:     if ($recipient_id < 2)
 80:         message($lang_common['Bad request']); 80:         message($lang_common['Bad request']);
 81:  81: 
 82:     $result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); 82:     $result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
120: 120: 
121:         pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');121:         pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');
122: 122: 
123:         redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);123:         redirect(htmlspecialchars($_POST['redirect_url']), $lang_misc['E-mail sent redirect']);
124:     }124:     }
125: 125: 
126: 126: 


punbb-1.2.5/upload/moderate.php punbb-1.2.14/upload/moderate.php
351:                         <br /><select name="move_to_forum">351:                         <br /><select name="move_to_forum">
352: <?php352: <?php
353: 353: 
354:     $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['group_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());354:     $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
355: 355: 
356:     $cur_category = 0;356:     $cur_category = 0;
357:     while ($cur_forum = $db->fetch_assoc($result))357:     while ($cur_forum = $db->fetch_assoc($result))


punbb-1.2.5/upload/post.php punbb-1.2.14/upload/post.php
 33:  33: 
 34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0; 34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
 35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0; 35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
 36: if ($tid < 1 && $fid < 1) 36: if ($tid < 1 && $fid < 1 || $tid > 0 && $fid > 0)
 37:     message($lang_common['Bad request']); 37:     message($lang_common['Bad request']);
 38:  38: 
 39: // Fetch some info about the topic and/or the forum 39: // Fetch some info about the topic and/or the forum
338:         if ($qid < 1)338:         if ($qid < 1)
339:             message($lang_common['Bad request']);339:             message($lang_common['Bad request']);
340: 340: 
341:         $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());341:         $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());
342:         if (!$db->num_rows($result))342:         if (!$db->num_rows($result))
343:             message($lang_common['Bad request']);343:             message($lang_common['Bad request']);
344: 344: 
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.5/upload/profile.php punbb-1.2.14/upload/profile.php
201:     }201:     }
202:     else if (isset($_POST['form_sent']))202:     else if (isset($_POST['form_sent']))
203:     {203:     {
 204:         if (pun_hash($_POST['req_password']) !== $pun_user['password'])
 205:             message($lang_profile['Wrong pass']);
 206: 
204:         require PUN_ROOT.'include/email.php';207:         require PUN_ROOT.'include/email.php';
205: 208: 
206:         // Validate the email-address209:         // Validate the email-address
264:     }267:     }
265: 268: 
266:     $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];269:     $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
267:     $required_fields = array('req_new_email' => $lang_profile['New e-mail']);270:     $required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
268:     $focus_element = array('change_email', 'req_new_email');271:     $focus_element = array('change_email', 'req_new_email');
269:     require PUN_ROOT.'header.php';272:     require PUN_ROOT.'header.php';
270: 273: 
279:                     <div class="infldset">282:                     <div class="infldset">
280:                         <input type="hidden" name="form_sent" value="1" />283:                         <input type="hidden" name="form_sent" value="1" />
281:                         <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>284:                         <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
 285:                         <label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
282:                         <p><?php echo $lang_profile['E-mail instructions'] ?></p>286:                         <p><?php echo $lang_profile['E-mail instructions'] ?></p>
283:                     </div>287:                     </div>
284:                 </fieldset>288:                 </fieldset>
362:                 message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');366:                 message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
363: 367: 
364:             // Now check the width/height368:             // Now check the width/height
365:             list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');369:             list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
366:             if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])370:             if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
367:             {371:             {
368:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');372:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
369:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');373:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
370:             }374:             }
 375:             else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
 376:             {
 377:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
 378:                 message($lang_profile['Bad type']);
 379:             }            
371: 380: 
372:             // Delete any old avatars and put the new one in place381:             // Delete any old avatars and put the new one in place
373:             @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);382:             @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
530:     $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());539:     $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
531:     list($group_id, $username) = $db->fetch_row($result);540:     list($group_id, $username) = $db->fetch_row($result);
532: 541: 
 542:     if ($group_id == PUN_ADMIN)
 543:         message('Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group.');
 544: 
533:     if (isset($_POST['delete_user_comply']))545:     if (isset($_POST['delete_user_comply']))
534:     {546:     {
535:         // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well547:         // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well
707:                     message($lang_common['Invalid e-mail']);719:                     message($lang_common['Invalid e-mail']);
708:             }720:             }
709: 721: 
 722:             // Make sure we got a valid language string
 723:             if (isset($form['language']))
 724:             {
 725:                 $form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']);
 726:                 if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php'))
 727:                         message($lang_common['Bad request']);
 728:             }
 729: 
710:             break;730:             break;
711:         }731:         }
712: 732: 
798:         {818:         {
799:             $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));819:             $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));
800: 820: 
801:             $form['email_setting'] == intval($form['email_setting']);821:             $form['email_setting'] = intval($form['email_setting']);
802:             if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;822:             if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;
803: 823: 
804:             if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';824:             if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';
820: 840: 
821: 841: 
822:     // Singlequotes around non-empty values and NULL for empty values842:     // Singlequotes around non-empty values and NULL for empty values
 843:     $temp = array();
823:     while (list($key, $input) = @each($form))844:     while (list($key, $input) = @each($form))
824:     {845:     {
825:         $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL';846:         $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL';
827:         $temp[] = $key.'='.$value;848:         $temp[] = $key.'='.$value;
828:     }849:     }
829: 850: 
 851:     if (empty($temp))
 852:         message($lang_common['Bad request']);
 853: 
830: 854: 
831:     $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());855:     $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());
832: 856: 
867: }891: }
868: 892: 
869: 893: 
870: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());894: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
871: if (!$db->num_rows($result))895: if (!$db->num_rows($result))
872:     message($lang_common['Bad request']);896:     message($lang_common['Bad request']);
873: 897: 
1131:         $d = dir(PUN_ROOT.'lang');1155:         $d = dir(PUN_ROOT.'lang');
1132:         while (($entry = $d->read()) !== false)1156:         while (($entry = $d->read()) !== false)
1133:         {1157:         {
1134:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))1158:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
1135:                 $languages[] = $entry;1159:                 $languages[] = $entry;
1136:         }1160:         }
1137:         $d->close();1161:         $d->close();
1139:         // Only display the language selection box if there's more than one language available1163:         // Only display the language selection box if there's more than one language available
1140:         if (count($languages) > 1)1164:         if (count($languages) > 1)
1141:         {1165:         {
 1166:             natsort($languages);
1142: 1167: 
1143: ?>1168: ?>
1144:                             <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>1169:                             <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
1147: 1172: 
1148:             while (list(, $temp) = @each($languages))1173:             while (list(, $temp) = @each($languages))
1149:             {1174:             {
1150:                 if ($pun_user['language'] == $temp)1175:                 if ($user['language'] == $temp)
1151:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";1176:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
1152:                 else1177:                 else
1153:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";1178:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
1350:             echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n";1375:             echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n";
1351:         else if (count($styles) > 1)1376:         else if (count($styles) > 1)
1352:         {1377:         {
 1378:             natsort($styles);
1353: 1379: 
1354: ?>1380: ?>
1355:                 <div class="inform">1381:                 <div class="inform">
1488:         }1514:         }
1489:         else1515:         else
1490:         {1516:         {
 1517:             if ($pun_user['id'] != $id)
 1518:             {
1491: 1519: 
1492: ?>1520: ?>
1493:                         <legend><?php echo $lang_profile['Group membership legend'] ?></legend>1521:                         <legend><?php echo $lang_profile['Group membership legend'] ?></legend>
1495:                             <select id="group_id" name="group_id">1523:                             <select id="group_id" name="group_id">
1496: <?php1524: <?php
1497: 1525: 
1498:             $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());1526:                 $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
1499: 1527: 
1500:             while ($cur_group = $db->fetch_assoc($result))1528:                 while ($cur_group = $db->fetch_assoc($result))
1501:             {1529:                 {
1502:                 if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == ''))1530:                     if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == ''))
1503:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";1531:                         echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
1504:                 else1532:                     else
1505:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";1533:                         echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
1506:             }1534:                 }
1507: 1535: 
1508: ?>1536: ?>
1509:                             </select>1537:                             </select>
1513:                 </div>1541:                 </div>
1514:                 <div class="inform">1542:                 <div class="inform">
1515:                     <fieldset>1543:                     <fieldset>
 1544: <?php
 1545: 
 1546:             }
 1547: 
 1548: ?>
1516:                         <legend><?php echo $lang_profile['Delete ban legend'] ?></legend>1549:                         <legend><?php echo $lang_profile['Delete ban legend'] ?></legend>
1517:                         <div class="infldset">1550:                         <div class="infldset">
1518:                             <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" />&nbsp;&nbsp;<input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" />1551:                             <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" />&nbsp;&nbsp;<input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" />


punbb-1.2.5/upload/register.php punbb-1.2.14/upload/register.php
 79:  79: 
 80: else if (isset($_POST['form_sent'])) 80: else if (isset($_POST['form_sent']))
 81: { 81: {
  82:     // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
  83:     $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());
  84: 
  85:     if ($db->num_rows($result))
  86:         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.');
  87: 
  88: 
 82:     $username = pun_trim($_POST['req_username']); 89:     $username = pun_trim($_POST['req_username']);
 83:     $email1 = strtolower(trim($_POST['req_email1'])); 90:     $email1 = strtolower(trim($_POST['req_email1']));
 84:  91: 
125:     }132:     }
126: 133: 
127:     // Check that the username (or a too similar username) is not already registered134:     // Check that the username (or a too similar username) is not already registered
128:     $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());135:     $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
129: 136: 
130:     if ($db->num_rows($result))137:     if ($db->num_rows($result))
131:     {138:     {
166:             $dupe_list[] = $cur_dupe['username'];173:             $dupe_list[] = $cur_dupe['username'];
167:     }174:     }
168: 175: 
 176:     // Make sure we got a valid language string
 177:     if (isset($_POST['language']))
 178:     {
 179:         $language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
 180:         if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
 181:                 message($lang_common['Bad request']);
 182:     }
 183:     else
 184:         $language = $pun_config['o_default_lang'];
 185: 
169:     $timezone = intval($_POST['timezone']);186:     $timezone = intval($_POST['timezone']);
170:     $language = isset($_POST['language']) ? $_POST['language'] : $pun_config['o_default_lang']; 
171:     $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';187:     $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
172: 188: 
173:     $email_setting = intval($_POST['email_setting']);189:     $email_setting = intval($_POST['email_setting']);
174:     if ($email_setting < 0 && $email_setting > 2) $email_setting = 1;190:     if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
175: 191: 
176:     // Insert the new user into the database. We do this now to get the last inserted id for later use.192:     // Insert the new user into the database. We do this now to get the last inserted id for later use.
177:     $now = time();193:     $now = time();
337:         $d = dir(PUN_ROOT.'lang');353:         $d = dir(PUN_ROOT.'lang');
338:         while (($entry = $d->read()) !== false)354:         while (($entry = $d->read()) !== false)
339:         {355:         {
340:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))356:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
341:                 $languages[] = $entry;357:                 $languages[] = $entry;
342:         }358:         }
343:         $d->close();359:         $d->close();


punbb-1.2.5/upload/search.php punbb-1.2.14/upload/search.php
 51:     $action = (isset($_GET['action'])) ? $_GET['action'] : null; 51:     $action = (isset($_GET['action'])) ? $_GET['action'] : null;
 52:     $forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1; 52:     $forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1;
 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:     if (isset($search_id)) unset($search_id);
 54:  55: 
 55:     // If a search_id was supplied 56:     // If a search_id was supplied
 56:     if (isset($_GET['search_id'])) 57:     if (isset($_GET['search_id']))
 65:         $keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null; 66:         $keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null;
 66:         $author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null; 67:         $author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null;
 67:  68: 
  69:         if (preg_match('#^[\*%]+$#', $keywords) || strlen(str_replace(array('*', '%'), '', $keywords)) < 3)
  70:             $keywords = '';
  71: 
  72:         if (preg_match('#^[\*%]+$#', $author) || strlen(str_replace(array('*', '%'), '', $author)) < 3)
  73:             $author = '';
  74: 
 68:         if (!$keywords && !$author) 75:         if (!$keywords && !$author)
 69:             message($lang_search['No terms']); 76:             message($lang_search['No terms']);
 70:  77: 
163: 170: 
164:                 $word_count = 0;171:                 $word_count = 0;
165:                 $match_type = 'and';172:                 $match_type = 'and';
 173:                 $result_list = array();
166:                 @reset($keywords_array);174:                 @reset($keywords_array);
167:                 while (list(, $cur_word) = @each($keywords_array))175:                 while (list(, $cur_word) = @each($keywords_array))
168:                 {176:                 {
380: 388: 
381: 389: 
382:         // Prune "old" search results390:         // Prune "old" search results
 391:         $old_searches = array();
383:         $result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());392:         $result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
384: 393: 
385:         if ($db->num_rows($result))394:         if ($db->num_rows($result))
457:             $sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;466:             $sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;
458:         }467:         }
459:         else468:         else
460:             $sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql;469:             $sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'topics AS t WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql;
461: 470: 
462: 471: 
463:         // Determine the topic or post offset (based on $_GET['p'])472:         // Determine the topic or post offset (based on $_GET['p'])
704: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST)713: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST)
705:     echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n";714:     echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n";
706: 715: 
707: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['group_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());716: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
708: 717: 
709: $cur_category = 0;718: $cur_category = 0;
710: while ($cur_forum = $db->fetch_assoc($result))719: while ($cur_forum = $db->fetch_assoc($result))


punbb-1.2.5/upload/style/imports/base.css punbb-1.2.14/upload/style/imports/base.css
 43:  43: 
 44: DIV>DIV>DIV.postfootleft, DIV>DIV>DIV.postfootright {PADDING-TOP: 1px; MARGIN-TOP: -1px} 44: DIV>DIV>DIV.postfootleft, DIV>DIV>DIV.postfootright {PADDING-TOP: 1px; MARGIN-TOP: -1px}
 45:  45: 
 46: /* 3.2 This is only visible to IE Windows and cures various bugs. Do not alter comments */ 46: /* 3.2 This is only visible to IE6 Windows and cures various bugs. Do not alter comments */
 47:  47: 
 48: /* Begin IEWin Fix \*/ 48: /* Begin IE6Win Fix \*/
 49: * HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px} 49: * HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px}
 50: * HTML .inbox DIV.postmsg {WIDTH: 98%} 50: * HTML .inbox DIV.postmsg {WIDTH: 98%}
 51: /* End of IEWin Fix */ 51: /* End of IE6Win Fix */
  52: 
  53: /* 3.3 This is the equivelant of 3.2 but for IE7. It is visible to other browsers
  54: but does no harm */
  55: 
  56: /*Begin IE7Win Fix */
  57: .pun, .pun .inbox, .pun .inform, .pun .intd, .pun .tclcon {min-height: 1px}
  58: /* End of IE7Win Fix */
 52:  59: 
 53: /****************************************************************/ 60: /****************************************************************/
 54: /* 4. HIDDEN ELEMENTS */ 61: /* 4. HIDDEN ELEMENTS */


punbb-1.2.5/upload/userlist.php punbb-1.2.14/upload/userlist.php
116:     $where_sql[] = 'u.group_id='.$show_group;116:     $where_sql[] = 'u.group_id='.$show_group;
117: 117: 
118: // Fetch user count118: // Fetch user count
119: $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());119: $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());
120: $num_users = $db->result($result);120: $num_users = $db->result($result);
121: 121: 
122: 122: 


punbb-1.2.5/upload/viewforum.php punbb-1.2.14/upload/viewforum.php
242: 242: 
243: <div class="linksb">243: <div class="linksb">
244:     <div class="inbox">244:     <div class="inbox">
245:         <p class="pagelink conl"><?php echo $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id) ?></p>245:         <p class="pagelink conl"><?php echo $paging_links ?></p>
246: <?php echo $post_link ?>246: <?php echo $post_link ?>
247:         <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&nbsp;</li><li>&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>247:         <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&nbsp;</li><li>&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
248:         <div class="clearer"></div>248:         <div class="clearer"></div>


punbb-1.2.5/upload/viewtopic.php punbb-1.2.14/upload/viewtopic.php
183: $post_count = 0;    // Keep track of post numbers183: $post_count = 0;    // Keep track of post numbers
184: 184: 
185: // Retrieve the posts (and their respective poster/online status)185: // Retrieve the posts (and their respective poster/online status)
186: $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());186: $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
187: while ($cur_post = $db->fetch_assoc($result))187: while ($cur_post = $db->fetch_assoc($result))
188: {188: {
189:     $post_count++;189:     $post_count++;


hdiff - version: 2.1.0 (modified)