PunBB 1.2.1 to 1.2.6 changes Legend
Lines removed 
Lines changed
 Lines added

punbb-1.2.1/upload/admin_bans.php punbb-1.2.6/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
244:     if ($_POST['mode'] == 'add')244:     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());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());
246:     else246:     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());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='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error());
248: 248: 
249:     // Regenerate the bans cache249:     // Regenerate the bans cache
250:     require_once PUN_ROOT.'include/cache.php';250:     require_once PUN_ROOT.'include/cache.php';


punbb-1.2.1/upload/admin_categories.php punbb-1.2.6/upload/admin_categories.php
123:                         </div>123:                         </div>
124:                     </fieldset>124:                     </fieldset>
125:                 </div>125:                 </div>
126:                 <p><input type="submit" name="del_cat_comply" value="Delete" />&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1)" />Go back</a></p>126:                 <p><input type="submit" name="del_cat_comply" value="Delete" /><a href="javascript:history.go(-1)">Go back</a></p>
127:             </form>127:             </form>
128:         </div>128:         </div>
129:     </div>129:     </div>


punbb-1.2.1/upload/admin_censoring.php punbb-1.2.6/upload/admin_censoring.php
 57: { 57: {
 58:     confirm_referrer('admin_censoring.php'); 58:     confirm_referrer('admin_censoring.php');
 59:  59: 
 60:     $id = key($_POST['update']); 60:     $id = intval(key($_POST['update']));
 61:  61: 
 62:     $search_for = trim($_POST['search_for'][$id]); 62:     $search_for = trim($_POST['search_for'][$id]);
 63:     $replace_with = trim($_POST['replace_with'][$id]); 63:     $replace_with = trim($_POST['replace_with'][$id]);
 76: { 76: {
 77:     confirm_referrer('admin_censoring.php'); 77:     confirm_referrer('admin_censoring.php');
 78:  78: 
 79:     $id = key($_POST['remove']); 79:     $id = intval(key($_POST['remove']));
 80:  80: 
 81:     $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error()); 81:     $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error());
 82:  82: 


punbb-1.2.1/upload/admin_forums.php punbb-1.2.6/upload/admin_forums.php
117:                         </div>117:                         </div>
118:                     </fieldset>118:                     </fieldset>
119:                 </div>119:                 </div>
120:                 <p><input type="submit" name="del_forum_comply" value="Delete" />&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1)" />Go back</a></p>120:                 <p><input type="submit" name="del_forum_comply" value="Delete" /><a href="javascript:history.go(-1)">Go back</a></p>
121:             </form>121:             </form>
122:         </div>122:         </div>
123:     </div>123:     </div>
229: 229: 
230:     // Fetch forum info230:     // Fetch forum info
231:     $result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());231:     $result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
 232:     if (!$db->num_rows($result))
 233:         message($lang_common['Bad request']);
 234: 
232:     $cur_forum = $db->fetch_assoc($result);235:     $cur_forum = $db->fetch_assoc($result);
233: 236: 
234: 237: 


punbb-1.2.1/upload/admin_groups.php punbb-1.2.6/upload/admin_groups.php
 54:             message($lang_common['Bad request']); 54:             message($lang_common['Bad request']);
 55:  55: 
 56:         $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error()); 56:         $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error());
  57:         if (!$db->num_rows($result))
  58:             message($lang_common['Bad request']);
  59: 
 57:         $group = $db->fetch_assoc($result); 60:         $group = $db->fetch_assoc($result);
 58:  61: 
 59:         $mode = 'edit'; 62:         $mode = 'edit';
206: 209: 
207:     $title = trim($_POST['req_title']);210:     $title = trim($_POST['req_title']);
208:     $user_title = trim($_POST['user_title']);211:     $user_title = trim($_POST['user_title']);
209:     $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1';212:     $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1';
210:     $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1';213:     $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1';
211:     $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1';214:     $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1';
212:     $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';
213:     $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';
214:     $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';
215:     $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';
216:     $search = isset($_POST['search']) ? $_POST['search'] : '1';219:     $search = isset($_POST['search']) ? intval($_POST['search']) : '1';
217:     $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1';220:     $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1';
218:     $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';
219:     $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';222:     $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';
220:     $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';223:     $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';
226: 229: 
227:     if ($_POST['mode'] == 'add')230:     if ($_POST['mode'] == 'add')
228:     {231:     {
229:         $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());232:         $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
230:         if ($db->num_rows())233:         if ($db->num_rows($result))
231:             message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.');234:             message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.');
232: 235: 
233:         $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error());236:         $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error());
239:             $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error());242:             $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error());
240:     }243:     }
241:     else244:     else
 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());
 247:         if ($db->num_rows($result))
 248:             message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.');
 249: 
242:         $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='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());
 251:     }
243: 252: 
244:     // Regenerate the quickjump cache253:     // Regenerate the quickjump cache
245:     require_once PUN_ROOT.'include/cache.php';254:     require_once PUN_ROOT.'include/cache.php';


punbb-1.2.1/upload/admin_index.php punbb-1.2.6/upload/admin_index.php
 64:  64: 
 65:  65: 
 66: // Show phpinfo() output 66: // Show phpinfo() output
 67: else if ($action == 'phpinfo') 67: else if ($action == 'phpinfo' && $pun_user['g_id'] == PUN_ADMIN)
 68: { 68: {
 69:     // Is phpinfo() a disabled function? 69:     // Is phpinfo() a disabled function?
 70:     if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false) 70:     if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false)
 93:  93: 
 94:  94: 
 95: // Get number of current visitors 95: // Get number of current visitors
 96: $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error()); 96: $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error());
 97: $num_online = $db->result($result); 97: $num_online = $db->result($result);
 98:  98: 
 99:  99: 


punbb-1.2.1/upload/admin_loader.php punbb-1.2.6/upload/admin_loader.php
 36:  36: 
 37:  37: 
 38: // The plugin to load should be supplied via GET 38: // The plugin to load should be supplied via GET
 39: $plugin = isset($_GET['plugin']) ? $_GET['plugin'] : null; 39: $plugin = isset($_GET['plugin']) ? $_GET['plugin'] : '';
 40: if (!$plugin) 40: if (!preg_match('/^AM?P_(\w*?)\.php$/i', $plugin))
 41:     message($lang_common['Bad request']); 41:     message($lang_common['Bad request']);
 42:  42: 
 43: // AP_ == Admins only, AMP_ == admins and moderators 43: // AP_ == Admins only, AMP_ == admins and moderators
 49: if (!file_exists(PUN_ROOT.'plugins/'.$plugin)) 49: if (!file_exists(PUN_ROOT.'plugins/'.$plugin))
 50:     message('There is no plugin called \''.$plugin.'\' in the plugin directory.'); 50:     message('There is no plugin called \''.$plugin.'\' in the plugin directory.');
 51:  51: 
  52: // Construct REQUEST_URI if it isn't set
  53: if (!isset($_SERVER['REQUEST_URI']))
  54:     $_SERVER['REQUEST_URI'] = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '').'?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
 52:  55: 
 53: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin; 56: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin;
 54: require PUN_ROOT.'header.php'; 57: require PUN_ROOT.'header.php';


punbb-1.2.1/upload/admin_options.php punbb-1.2.6/upload/admin_options.php
 38: if (isset($_POST['form_sent'])) 38: if (isset($_POST['form_sent']))
 39: { 39: {
 40:     // Lazy referer check (in case base_url isn't correct) 40:     // Lazy referer check (in case base_url isn't correct)
 41:     if (!preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER'])) 41:     if (!isset($_SERVER['HTTP_REFERER']) || !preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER']))
 42:         message($lang_common['Bad referrer']); 42:         message($lang_common['Bad referrer']);
 43:  43: 
 44:     $form = array_map('trim', $_POST['form']); 44:     $form = array_map('trim', $_POST['form']);
117:     while (list($key, $input) = @each($form))117:     while (list($key, $input) = @each($form))
118:     {118:     {
119:         // Only update values that have changed119:         // Only update values that have changed
120:         if ($pun_config['o_'.$key] != $input)120:         if (isset($pun_config['o_'.$key]) && $pun_config['o_'.$key] != $input)
121:         {121:         {
122:             if ($input != '' || is_int($input))122:             if ($input != '' || is_int($input))
123:                 $value = '\''.$db->escape($input).'\'';123:                 $value = '\''.$db->escape($input).'\'';
124:             else124:             else
125:                 $value = 'NULL';125:                 $value = 'NULL';
126: 126: 
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());127:             $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:         }128:         }
129:     }129:     }
130: 130: 
229:         $d = dir(PUN_ROOT.'lang');229:         $d = dir(PUN_ROOT.'lang');
230:         while (($entry = $d->read()) !== false)230:         while (($entry = $d->read()) !== false)
231:         {231:         {
232:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))232:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
233:                 $languages[] = $entry;233:                 $languages[] = $entry;
234:         }234:         }
235:         $d->close();235:         $d->close();
236: 236: 
 237:         @natsort($languages);
 238: 
237:         while (list(, $temp) = @each($languages))239:         while (list(, $temp) = @each($languages))
238:         {240:         {
239:             if ($pun_config['o_default_lang'] == $temp)241:             if ($pun_config['o_default_lang'] == $temp)
261:                 $styles[] = substr($entry, 0, strlen($entry)-4);263:                 $styles[] = substr($entry, 0, strlen($entry)-4);
262:         }264:         }
263:         $d->close();265:         $d->close();
 266: 
 267:         @natsort($styles);
264: 268: 
265:         while (list(, $temp) = @each($styles))269:         while (list(, $temp) = @each($styles))
266:         {270:         {


punbb-1.2.1/upload/admin_permissions.php punbb-1.2.6/upload/admin_permissions.php
 47:     while (list($key, $input) = @each($form)) 47:     while (list($key, $input) = @each($form))
 48:     { 48:     {
 49:         // Only update values that have changed 49:         // Only update values that have changed
 50:         if ($pun_config['p_'.$key] != $input) 50:         if (isset($pun_config['p_'.$key]) && $pun_config['p_'.$key] != $input)
 51:         { 51:         {
 52:             if ($input != '' || is_int($input)) 52:             if ($input != '' || is_int($input))
 53:                 $value = '\''.$db->escape($input).'\''; 53:                 $value = '\''.$db->escape($input).'\'';


punbb-1.2.1/upload/admin_prune.php punbb-1.2.6/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)
135:                         </div>137:                         </div>
136:                     </fieldset>138:                     </fieldset>
137:                 </div>139:                 </div>
138:                 <p><input type="submit" name="prune_comply" value="Prune" />&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1)" />Go back</a></p>140:                 <p><input type="submit" name="prune_comply" value="Prune" /><a href="javascript:history.go(-1)">Go back</a></p>
139:             </form>141:             </form>
140:         </div>142:         </div>
141:     </div>143:     </div>


punbb-1.2.1/upload/admin_ranks.php punbb-1.2.6/upload/admin_ranks.php
 69: { 69: {
 70:     confirm_referrer('admin_ranks.php'); 70:     confirm_referrer('admin_ranks.php');
 71:  71: 
 72:     $id = key($_POST['update']); 72:     $id = intval(key($_POST['update']));
 73:  73: 
 74:     $rank = trim($_POST['rank'][$id]); 74:     $rank = trim($_POST['rank'][$id]);
 75:     $min_posts = trim($_POST['min_posts'][$id]); 75:     $min_posts = trim($_POST['min_posts'][$id]);
100: {100: {
101:     confirm_referrer('admin_ranks.php');101:     confirm_referrer('admin_ranks.php');
102: 102: 
103:     $id = key($_POST['remove']);103:     $id = intval(key($_POST['remove']));
104: 104: 
105:     $db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error());105:     $db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error());
106: 106: 


punbb-1.2.1/upload/admin_reports.php punbb-1.2.6/upload/admin_reports.php
 40: { 40: {
 41:     confirm_referrer('admin_reports.php'); 41:     confirm_referrer('admin_reports.php');
 42:  42: 
 43:     $zap_id = key($_POST['zap_id']); 43:     $zap_id = intval(key($_POST['zap_id']));
 44:  44: 
 45:     $result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error()); 45:     $result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error());
 46:     $zapped = $db->result($result); 46:     $zapped = $db->result($result);


punbb-1.2.1/upload/admin_users.php punbb-1.2.6/upload/admin_users.php
 49: ?> 49: ?>
 50: <div class="linkst"> 50: <div class="linkst">
 51:     <div class="inbox"> 51:     <div class="inbox">
 52:         <div><a href="javascript:history.go(-1)" />Go back</a></div> 52:         <div><a href="javascript:history.go(-1)">Go back</a></div>
 53:     </div> 53:     </div>
 54: </div> 54: </div>
 55:  55: 
 98:  98: 
 99: <div class="linksb"> 99: <div class="linksb">
100:     <div class="inbox">100:     <div class="inbox">
101:         <div><a href="javascript:history.go(-1)" />Go back</a></div>101:         <div><a href="javascript:history.go(-1)">Go back</a></div>
102:     </div>102:     </div>
103: </div>103: </div>
104: <?php104: <?php
121: ?>121: ?>
122: <div class="linkst">122: <div class="linkst">
123:     <div class="inbox">123:     <div class="inbox">
124:         <div><a href="javascript:history.go(-1)" />Go back</a></div>124:         <div><a href="javascript:history.go(-1)">Go back</a></div>
125:     </div>125:     </div>
126: </div>126: </div>
127: 127: 
202: 202: 
203: <div class="linksb">203: <div class="linksb">
204:     <div class="inbox">204:     <div class="inbox">
205:         <div><a href="javascript:history.go(-1)" />Go back</a></div>205:         <div><a href="javascript:history.go(-1)">Go back</a></div>
206:     </div>206:     </div>
207: </div>207: </div>
208: <?php208: <?php
257:     while (list($key, $input) = @each($form))257:     while (list($key, $input) = @each($form))
258:     {258:     {
259:         if ($input != '')259:         if ($input != '')
260:             $conditions[] = 'u.'.$key.' '.$like_command.' \''.str_replace('*', '%', $input).'\'';260:             $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
261:     }261:     }
262: 262: 
263:     if ($posts_greater != '')263:     if ($posts_greater != '')
266:         $conditions[] = 'u.num_posts<'.$posts_less;266:         $conditions[] = 'u.num_posts<'.$posts_less;
267: 267: 
268:     if ($user_group != 'all')268:     if ($user_group != 'all')
269:         $conditions[] = 'u.group_id='.$user_group;269:         $conditions[] = 'u.group_id='.$db->escape($user_group);
270: 270: 
271:     if (!isset($conditions))271:     if (!isset($conditions))
272:         message('You didn\'t enter any search terms.');272:         message('You didn\'t enter any search terms.');
278: ?>278: ?>
279: <div class="linkst">279: <div class="linkst">
280:     <div class="inbox">280:     <div class="inbox">
281:         <div><a href="javascript:history.go(-1)" />Go back</a></div>281:         <div><a href="javascript:history.go(-1)">Go back</a></div>
282:     </div>282:     </div>
283: </div>283: </div>
284: 284: 
300:             <tbody>300:             <tbody>
301: <?php301: <?php
302: 302: 
303:     $result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, 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>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$order_by.' '.$direction) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());303:     $result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, 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>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
304:     if ($db->num_rows($result))304:     if ($db->num_rows($result))
305:     {305:     {
306:         while ($user_data = $db->fetch_assoc($result))306:         while ($user_data = $db->fetch_assoc($result))
338: 338: 
339: <div class="linksb">339: <div class="linksb">
340:     <div class="inbox">340:     <div class="inbox">
341:         <div><a href="javascript:history.go(-1)" />Go back</a></div>341:         <div><a href="javascript:history.go(-1)">Go back</a></div>
342:     </div>342:     </div>
343: </div>343: </div>
344: <?php344: <?php


punbb-1.2.1/upload/extern.php punbb-1.2.6/upload/extern.php
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.1/upload/footer.php punbb-1.2.6/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();
150: }153: }
151: // END SUBST - <pun_include "*">154: // END SUBST - <pun_include "*">


punbb-1.2.1/upload/header.php punbb-1.2.6/upload/header.php
 15:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 15:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16:   GNU General Public License for more details. 16:   GNU General Public License for more details.
 17:  17: 
 18:   You should have received a copy of the GNU G>eneral Public License 18:   You should have received a copy of the GNU General Public License
 19:   along with this program; if not, write to the Free Software 19:   along with this program; if not, write to the Free Software
 20:   Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20:   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 21:   MA  02111-1307  USA 21:   MA  02111-1307  USA
 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: 
171:             $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';168:             $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
172:     }169:     }
173: 170: 
174:     if (basename($_SERVER['PHP_SELF']) == 'index.php')171:     if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
175:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';172:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
176:     else if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'action=show_new') 
177:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<p class="conr"><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; 
178:     else173:     else
179:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';174:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
180: }175: }


punbb-1.2.1/upload/help.php punbb-1.2.6/upload/help.php
 86:         &nbsp;&nbsp;&nbsp;&nbsp;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br /> 86:         &nbsp;&nbsp;&nbsp;&nbsp;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
 87:         <?php echo $lang_help['produces quote box'] ?><br /><br /> 87:         <?php echo $lang_help['produces quote box'] ?><br /><br />
 88:         <div class="postmsg"> 88:         <div class="postmsg">
 89:             <blockquote><div class="incqbox"></h4><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote> 89:             <blockquote><div class="incqbox"><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
 90:         </div> 90:         </div>
 91:     </div> 91:     </div>
 92: </div> 92: </div>


punbb-1.2.1/upload/include/cache.php punbb-1.2.6/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.1/upload/include/common.php punbb-1.2.6/upload/include/common.php
 43: list($usec, $sec) = explode(' ', microtime()); 43: list($usec, $sec) = explode(' ', microtime());
 44: $pun_start = ((float)$usec + (float)$sec); 44: $pun_start = ((float)$usec + (float)$sec);
 45:  45: 
 46: // Enable full error, warning and notice reporting 46: // 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); 47: error_reporting(E_ALL ^ E_NOTICE);
 48:  48: 
 49: // Turn off magic_quotes_runtime 49: // Turn off magic_quotes_runtime
 50: set_magic_quotes_runtime(0); 50: set_magic_quotes_runtime(0);
117: // Attempt to load the common language file117: // Attempt to load the common language file
118: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';118: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
119: if (!isset($lang_common))119: if (!isset($lang_common))
120:     exit('There is no valid language pack \''.$pun_user['language'].'\' installed. Please reinstall a language of that name.');120:     exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.');
121: 121: 
122: // Check if we are to display a maintenance message122: // 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'))123: if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))


punbb-1.2.1/upload/include/dblayer/common_db.php punbb-1.2.6/upload/include/dblayer/common_db.php
 23: ************************************************************************/ 23: ************************************************************************/
 24:  24: 
 25:  25: 
  26: // Make sure no one attempts to run this script "directly"
  27: if (!defined('PUN'))
  28:     exit;
  29: 
  30: 
 26: // 31: //
 27: // Return current timestamp (with microseconds) as a float (used in dblayer) 32: // Return current timestamp (with microseconds) as a float (used in dblayer)
 28: // 33: //


punbb-1.2.1/upload/include/email.php punbb-1.2.6/upload/include/email.php
 33: // 33: //
 34: function is_valid_email($email) 34: function is_valid_email($email)
 35: { 35: {
 36:     return preg_match('#^.{1,}@.{2,}\..{2,}$#', $email); 36:     if (strlen($email) > 50)
  37:         return false;
  38: 
  39:     return 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);
 37: } 40: }
 38:  41: 
 39:  42: 
 65:  68: 
 66:     // Default sender/return address 69:     // Default sender/return address
 67:     if (!$from) 70:     if (!$from)
 68:         $from = '"'.$pun_config['o_board_title'].' '.$lang_common['Mailer'].'" <'.$pun_config['o_webmaster_email'].'>'; 71:         $from = '"'.str_replace('"', '', $pun_config['o_board_title'].' '.$lang_common['Mailer']).'" <'.$pun_config['o_webmaster_email'].'>';
 69:  72: 
 70:     // Make sure the from line doesn't contain a colon (the character, that is :D) 73:     // Do a little spring cleaning
 71:     $from = str_replace(':', ' ', $from); 74:     $to = trim(preg_replace('#[\n\r]+#s', '', $to));
  75:     $subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
  76:     $from = trim(preg_replace('#[\n\r:]+#s', '', $from));
 72:  77: 
 73:     // Detect what linebreak we should use for the headers 78:     // Detect what linebreak we should use for the headers
 74:     if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) 79:     if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN'))
 75:         $eol = "\r\n"; 80:         $eol = "\r\n";
 76:     else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) 81:     else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC'))
 77:         $eol = "\r"; 82:         $eol = "\r";
 78:     else 83:     else
 79:         $eol = "\n"; 84:         $eol = "\n";
 80:  85: 
 81:     $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'; 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';
 82:  87: 


punbb-1.2.1/upload/include/functions.php punbb-1.2.6/upload/include/functions.php
 46:         $pun_user = $db->fetch_assoc($result); 46:         $pun_user = $db->fetch_assoc($result);
 47:  47: 
 48:         // If user authorisation failed 48:         // If user authorisation failed
 49:         if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) != $cookie['password_hash']) 49:         if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash'])
 50:         { 50:         {
 51:             pun_setcookie(0, random_pass(8), $expire); 51:             pun_setcookie(0, random_pass(8), $expire);
 52:             set_default_user(); 52:             set_default_user();
108: 108: 
109:     // Fetch guest user109:     // Fetch guest user
110:     $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());110:     $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
 111:     if (!$db->num_rows($result))
 112:         exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.');
 113: 
111:     $pun_user = $db->fetch_assoc($result);114:     $pun_user = $db->fetch_assoc($result);
112: 115: 
113:     // Update online list116:     // Update online list
229:     global $pun_config, $lang_common, $pun_user;232:     global $pun_config, $lang_common, $pun_user;
230: 233: 
231:     // Index and Userlist should always be displayed234:     // Index and Userlist should always be displayed
232:     $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';235:     $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
233:     $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';236:     $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';
234: 237: 
235:     if ($pun_config['o_rules'] == '1')238:     if ($pun_config['o_rules'] == '1')
236:         $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';239:         $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
 240: 
 241:     if ($pun_user['is_guest'])
 242:     {
 243:         if ($pun_user['g_search'] == '1')
 244:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
 245: 
 246:         $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>';
 247:         $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>';
237: 248: 
238:     if ($pun_user['is_guest'])249:         $info = $lang_common['Not logged in'];
239:     {250:     }
240:         if ($pun_user['g_search'] == '1') 
241:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; 
242:  
243:         $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; 
244:         $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; 
245:  
246:         $info = $lang_common['Not logged in']; 
247:     } 
248:     else251:     else
249:     {252:     {
250:         if ($pun_user['g_id'] > PUN_MOD)253:         if ($pun_user['g_id'] > PUN_MOD)
251:         {254:         {
252:             if ($pun_user['g_search'] == '1')255:             if ($pun_user['g_search'] == '1')
253:                 $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';256:                 $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
254: 257: 
255:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';258:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
256:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';259:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
257:         }260:         }
258:         else261:         else
259:         {262:         {
260:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';263:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
261:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';264:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
262:             $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';265:             $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';
263:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';266:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
264:         }267:         }
265:     }268:     }
266: 269: 
267:     // Are there any additional navlinks we should insert into the array before imploding it?270:     // Are there any additional navlinks we should insert into the array before imploding it?
268:     if ($pun_config['o_additional_navlinks'] != '')271:     if ($pun_config['o_additional_navlinks'] != '')
271:         {274:         {
272:             // Insert any additional links into the $links array (at the correct index)275:             // Insert any additional links into the $links array (at the correct index)
273:             for ($i = 0; $i < count($extra_links[1]); ++$i)276:             for ($i = 0; $i < count($extra_links[1]); ++$i)
274:                 array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));277:                 array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
275:         }278:         }
276:     }279:     }
277: 280: 
278:     return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';281:     return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';
279: }282: }
280: 283: 
281: 284: 
736: 739: 
737:     if (strpos($lang_common['lang_encoding'], '8859') !== false)740:     if (strpos($lang_common['lang_encoding'], '8859') !== false)
738:     {741:     {
739:         $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA));742:         $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0));
740:         return trim(str_replace($fishy_chars, ' ', $str));743:         return trim(str_replace($fishy_chars, ' ', $str));
741:     }744:     }
742:     else745:     else
800: 803: 
801: 804: 
802:     // START SUBST - <pun_include "*">805:     // START SUBST - <pun_include "*">
803:     while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include))806:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include))
804:     {807:     {
 808:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 809:             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/');
 810: 
805:         ob_start();811:         ob_start();
806:         include PUN_ROOT.$cur_include[1];812:         include PUN_ROOT.'include/user/'.$cur_include[1];
807:         $tpl_temp = ob_get_contents();813:         $tpl_temp = ob_get_contents();
808:         $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint);814:         $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint);
809:         ob_end_clean();815:         ob_end_clean();
810:     }816:     }
811:     // END SUBST - <pun_include "*">817:     // END SUBST - <pun_include "*">
851:     ob_start();857:     ob_start();
852: 858: 
853: ?>859: ?>
854: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" />860: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) ?>" />
855: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>861: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>
856: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />862: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
857: <?php863: <?php
890: 896: 
891: 897: 
892:     // START SUBST - <pun_include "*">898:     // START SUBST - <pun_include "*">
893:     while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include))899:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_redir, $cur_include))
894:     {900:     {
 901:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 902:             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/');
 903: 
895:         ob_start();904:         ob_start();
896:         include PUN_ROOT.$cur_include[1];905:         include PUN_ROOT.'include/user/'.$cur_include[1];
897:         $tpl_temp = ob_get_contents();906:         $tpl_temp = ob_get_contents();
898:         $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir);907:         $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
899:         ob_end_clean();908:         ob_end_clean();
900:     }909:     }
901:     // END SUBST - <pun_include "*">910:     // END SUBST - <pun_include "*">


punbb-1.2.1/upload/include/parser.php punbb-1.2.6/upload/include/parser.php
 45:     $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]'); 45:     $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
 46:     $text = str_replace($a, $b, $text); 46:     $text = str_replace($a, $b, $text);
 47:  47: 
 48:     // Do the more complex BBCodes (and strip excessive whitespace) 48:     // Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
 49:     $a = array( '#\[url=(.*?)\]\s*#i', 49:     $a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
 50:                 '#\[url\]\s*#i', 50:                 '#\[url\]\s*#i',
 51:             &n