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

punbb-1.2.2/upload/admin_categories.php punbb-1.2.5/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.2/upload/admin_censoring.php punbb-1.2.5/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.2/upload/admin_forums.php punbb-1.2.5/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>


punbb-1.2.2/upload/admin_groups.php punbb-1.2.5/upload/admin_groups.php
229: 229: 
230:     if ($_POST['mode'] == 'add')230:     if ($_POST['mode'] == 'add')
231:     {231:     {
232:         $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());
233:         if ($db->num_rows())233:         if ($db->num_rows($result))
234:             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).'\'.');
235: 235: 
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());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());
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());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());
243:     }243:     }
244:     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: 
245:         $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:     }
246: 252: 
247:     // Regenerate the quickjump cache253:     // Regenerate the quickjump cache
248:     require_once PUN_ROOT.'include/cache.php';254:     require_once PUN_ROOT.'include/cache.php';


punbb-1.2.2/upload/admin_index.php punbb-1.2.5/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.2/upload/admin_options.php punbb-1.2.5/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']);


punbb-1.2.2/upload/admin_prune.php punbb-1.2.5/upload/admin_prune.php
135:                         </div>135:                         </div>
136:                     </fieldset>136:                     </fieldset>
137:                 </div>137:                 </div>
138:                 <p><input type="submit" name="prune_comply" value="Prune" />&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1)" />Go back</a></p>138:                 <p><input type="submit" name="prune_comply" value="Prune" /><a href="javascript:history.go(-1)">Go back</a></p>
139:             </form>139:             </form>
140:         </div>140:         </div>
141:     </div>141:     </div>


punbb-1.2.2/upload/admin_ranks.php punbb-1.2.5/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.2/upload/admin_reports.php punbb-1.2.5/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.2/upload/admin_users.php punbb-1.2.5/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
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.2/upload/header.php punbb-1.2.5/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
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>';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>';
172:     }172:     }
173: 173: 
174:     if (basename($_SERVER['PHP_SELF']) == 'index.php')174:     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>';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>';
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:     else176:     else
179:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';177:         $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
180: }178: }


punbb-1.2.2/upload/help.php punbb-1.2.5/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.2/upload/include/dblayer/common_db.php punbb-1.2.5/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.2/upload/include/email.php punbb-1.2.5/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'))


punbb-1.2.2/upload/include/functions.php punbb-1.2.5/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();
739: 739: 
740:     if (strpos($lang_common['lang_encoding'], '8859') !== false)740:     if (strpos($lang_common['lang_encoding'], '8859') !== false)
741:     {741:     {
742:         $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));
743:         return trim(str_replace($fishy_chars, ' ', $str));743:         return trim(str_replace($fishy_chars, ' ', $str));
744:     }744:     }
745:     else745:     else


punbb-1.2.2/upload/include/parser.php punbb-1.2.5/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:                 '#\s*\[/url\]#i', 51:                 '#\s*\[/url\]#i',
 52:                 '#\[email=(.*?)\]\s*#i', 52:                 '#\[email=("|\'|)(.*?)\\1\]\s*#i',
 53:                 '#\[email\]\s*#i', 53:                 '#\[email\]\s*#i',
 54:                 '#\s*\[/email\]#i', 54:                 '#\s*\[/email\]#i',
 55:                 '#\[img\]\s*(.*?)\s*\[/img\]#is', 55:                 '#\[img\]\s*(.*?)\s*\[/img\]#is',
 56:                 '#\[colou?r=(.*?)\](.*?)\[/colou?r\]#is'); 56:                 '#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
 57:  57: 
 58:     $b = array(    '[url=$1]', 58:     $b = array(    '[url=$2]',
 59:                 '[url]', 59:                 '[url]',
 60:                 '[/url]', 60:                 '[/url]',
 61:                 '[email=$1]', 61:                 '[email=$2]',
 62:                 '[email]', 62:                 '[email]',
 63:                 '[/email]', 63:                 '[/email]',
 64:                 '[img]$1[/img]', 64:                 '[img]$1[/img]',
 65:                 '[color=$1]$2[/color]'); 65:                 '[color=$2]$3[/color]');
 66:  66: 
 67:     if (!$is_signature) 67:     if (!$is_signature)
 68:     { 68:     {
 69:         // For non-signatures, we have to do the quote and code tags as well 69:         // For non-signatures, we have to do the quote and code tags as well
 70:         $a[] = '#\[quote=(&quot;|"|\'|)(.*)\\1\]\s*#i'; 70:         $a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
 71:         $a[] = '#\[quote\]\s*#i'; 71:         $a[] = '#\[quote\]\s*#i';
 72:         $a[] = '#\s*\[/quote\]\s*#i'; 72:         $a[] = '#\s*\[/quote\]\s*#i';
 73:         $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is'; 73:         $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
182:         // We found a [code]182:         // We found a [code]
183:         else if ($c_start < min($c_end, $q_start, $q_end))183:         else if ($c_start < min($c_end, $q_start, $q_end))
184:         {184:         {
 185:             // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
185:             $tmp = strpos($text, '[/code]');186:             $tmp = strpos($text, '[/code]');
186:             if ($tmp === false)187:             $tmp2 = strpos(substr($text, 6), '[code]');
 188:             if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
187:             {189:             {
188:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];190:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
189:                 return;191:                 return;


punbb-1.2.2/upload/install.php punbb-1.2.5/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.2'; 27: $punbb_version = '1.2.5';
 28:  28: 
 29:  29: 
 30: define('PUN_ROOT', './'); 30: define('PUN_ROOT', './');


punbb-1.2.2/upload/login.php punbb-1.2.5/upload/login.php
 40:     $form_username = trim($_POST['req_username']); 40:     $form_username = trim($_POST['req_username']);
 41:     $form_password = trim($_POST['req_password']); 41:     $form_password = trim($_POST['req_password']);
 42:  42: 
 43:     $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE username=\''.$db->escape($form_username).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); 43:     $username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
  44: 
  45:     $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
 44:     list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result); 46:     list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
 45:  47: 
 46:     $authorized = false; 48:     $authorized = false;


punbb-1.2.2/upload/misc.php punbb-1.2.5/upload/misc.php
118: 118: 
119:         require_once PUN_ROOT.'include/email.php';119:         require_once PUN_ROOT.'include/email.php';
120: 120: 
121:         pun_mail($recipient_email, $mail_subject, $mail_message, $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($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);
124:     }124:     }
245: 245: 
246: else if (isset($_GET['subscribe']))246: else if (isset($_GET['subscribe']))
247: {247: {
248:     if ($pun_user['is_guest'])248:     if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
249:         message($lang_common['No permission']);249:         message($lang_common['No permission']);
250: 250: 
251:     $topic_id = intval($_GET['subscribe']);251:     $topic_id = intval($_GET['subscribe']);
264: 264: 
265: else if (isset($_GET['unsubscribe']))265: else if (isset($_GET['unsubscribe']))
266: {266: {
267:     if ($pun_user['is_guest'])267:     if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
268:         message($lang_common['No permission']);268:         message($lang_common['No permission']);
269: 269: 
270:     $topic_id = intval($_GET['unsubscribe']);270:     $topic_id = intval($_GET['unsubscribe']);


punbb-1.2.2/upload/moderate.php punbb-1.2.5/upload/moderate.php
 50:         $ip = $db->result($result); 50:         $ip = $db->result($result);
 51:     } 51:     }
 52:  52: 
 53:     message('The IP address is: '.$ip.'<br />The host name is: '.gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>'); 53:     message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
 54: } 54: }
 55:  55: 
 56:  56: 
285:             message($lang_common['Bad request']);285:             message($lang_common['Bad request']);
286: 286: 
287:         $topics = explode(',', $_POST['topics']);287:         $topics = explode(',', $_POST['topics']);
288:         $move_to_forum = intval($_POST['move_to_forum']);288:         $move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0;
289:         if (empty($topics) || $move_to_forum < 1)289:         if (empty($topics) || $move_to_forum < 1)
290:             message($lang_common['Bad request']);290:             message($lang_common['Bad request']);
291: 291: 
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 WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') 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['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());
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))
472:         if (empty($topics))472:         if (empty($topics))
473:             message($lang_misc['No topics selected']);473:             message($lang_misc['No topics selected']);
474: 474: 
475:         $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', array_keys($topics)).')') or error('Unable to close topics', __FILE__, __LINE__, $db->error());475:         $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).')') or error('Unable to close topics', __FILE__, __LINE__, $db->error());
476: 476: 
477:         $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];477:         $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];
478:         redirect('moderate.php?fid='.$fid, $redirect_msg);478:         redirect('moderate.php?fid='.$fid, $redirect_msg);


punbb-1.2.2/upload/post.php punbb-1.2.5/upload/post.php
207: 207: 
208:             update_forum($cur_posting['id']);208:             update_forum($cur_posting['id']);
209: 209: 
210: 210:             // Should we send out notifications?
211:             // Get the post time for the previous post in this topic211:             if ($pun_config['o_subscriptions'] == '1')
212:             $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); 
213:             $previous_post_time = $db->result($result); 
214:  
215:             // Get any subscribed users that should be notified (banned users are excluded) 
216:             $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error()); 
217:             if ($db->num_rows($result)) 
218:             {212:             {
219:                 require_once PUN_ROOT.'include/email.php';213:                 // Get the post time for the previous post in this topic
 214:                 $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
 215:                 $previous_post_time = $db->result($result);
 216: 
 217:                 // Get any subscribed users that should be notified (banned users are excluded)
 218:                 $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
 219:                 if ($db->num_rows($result))
 220:                 {
 221:                     require_once PUN_ROOT.'include/email.php';
220: 222: 
221:                 $notification_emails = array();223:                     $notification_emails = array();
222: 224: 
223:                 // Loop through subscribed users and send e-mails225:                     // Loop through subscribed users and send e-mails
224:                 while ($cur_subscriber = $db->fetch_assoc($result))226:                     while ($cur_subscriber = $db->fetch_assoc($result))
225:                 { 
226:                     // Is the subscription e-mail for $cur_subscriber['language'] cached or not? 
227:                     if (!isset($notification_emails[$cur_subscriber['language']])) 
228:                     {227:                     {
229:                         if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'))228:                         // Is the subscription e-mail for $cur_subscriber['language'] cached or not?
 229:                         if (!isset($notification_emails[$cur_subscriber['language']]))
230:                         {230:                         {
231:                             // Load the "new reply" template231:                             if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'))
232:                             $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'));232:                             {
233: 233:                                 // Load the "new reply" template
234:                             // Load the "new reply full" template (with post included)234:                                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'));
235:                             $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl'));235: 
 236:                                 // Load the "new reply full" template (with post included)
 237:                                 $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl'));
 238: 
 239:                                 // The first row contains the subject (it also starts with "Subject:")
 240:                                 $first_crlf = strpos($mail_tpl, "\n");
 241:                                 $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
 242:                                 $mail_message = trim(substr($mail_tpl, $first_crlf));
 243: 
 244:                                 $first_crlf = strpos($mail_tpl_full, "\n");
 245:                                 $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));
 246:                                 $mail_message_full = trim(substr($mail_tpl_full, $first_crlf));
 247: 
 248:                                 $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);
 249:                                 $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);
 250:                                 $mail_message = str_replace('<replier>', $username, $mail_message);
 251:                                 $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
 252:                                 $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message);
 253:                                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
 254: 
 255:                                 $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);
 256:                                 $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);
 257:                                 $mail_message_full = str_replace('<replier>', $username, $mail_message_full);
 258:                                 $mail_message_full = str_replace('<message>', $message, $mail_message_full);
 259:                                 $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
 260:                                 $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full);
 261:                                 $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
 262: 
 263:                                 $notification_emails[$cur_subscriber['language']][0] = $mail_subject;
 264:                                 $notification_emails[$cur_subscriber['language']][1] = $mail_message;
 265:                                 $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full;
 266:                                 $notification_emails[$cur_subscriber['language']][3] = $mail_message_full;
236: 267: 
237:                             // The first row contains the subject (it also starts with "Subject:")268:                                 $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null;
238:                             $first_crlf = strpos($mail_tpl, "\n");269:                             }
239:                             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8)); 
240:                             $mail_message = trim(substr($mail_tpl, $first_crlf)); 
241:  
242:                             $first_crlf = strpos($mail_tpl_full, "\n"); 
243:                             $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8)); 
244:                             $mail_message_full = trim(substr($mail_tpl_full, $first_crlf)); 
245:  
246:                             $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject); 
247:                             $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message); 
248:                             $mail_message = str_replace('<replier>', $username, $mail_message); 
249:                             $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); 
250:                             $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message); 
251:                             $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message); 
252:  
253:                             $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full); 
254:                             $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full); 
255:                             $mail_message_full = str_replace('<replier>', $username, $mail_message_full); 
256:                             $mail_message_full = str_replace('<message>', $message, $mail_message_full); 
257:                             $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full); 
258:                             $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full); 
259:                             $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full); 
260:  
261:                             $notification_emails[$cur_subscriber['language']][0] = $mail_subject; 
262:                             $notification_emails[$cur_subscriber['language']][1] = $mail_message; 
263:                             $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full; 
264:                             $notification_emails[$cur_subscriber['language']][3] = $mail_message_full; 
265:  
266:                             $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null; 
267:                         }270:                         }
268:                     } 
269: 271: 
270:                     // We have to double check here because the templates could be missing272:                         // We have to double check here because the templates could be missing
271:                     if (isset($notification_emails[$cur_subscriber['language']]))273:                         if (isset($notification_emails[$cur_subscriber['language']]))
272:                     {274:                         {
273:                         if ($cur_subscriber['notify_with_post'] == '0')275:                             if ($cur_subscriber['notify_with_post'] == '0')
274:                             pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);276:                                 pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);
275:                         else277:                             else
276:                             pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);278:                                 pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);
 279:                         }
277:                     }280:                     }
278:                 }281:                 }
279:             }282:             }


punbb-1.2.2/upload/profile.php punbb-1.2.5/upload/profile.php
 59:         $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error()); 59:         $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error());
 60:         list($new_password_hash, $new_password_key) = $db->fetch_row($result); 60:         list($new_password_hash, $new_password_key) = $db->fetch_row($result);
 61:  61: 
 62:         if ($key != $new_password_key) 62:         if ($key == '' || $key != $new_password_key)
 63:             message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); 63:             message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 64:         else 64:         else
 65:         { 65:         {
194:             message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');194:             message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
195:         else195:         else
196:         {196:         {
197:             $db->query('UPDATE '.$db->prefix.'users SET email=\''.$new_email.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());197:             $db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());
198: 198: 
199:             message($lang_profile['E-mail updated'], true);199:             message($lang_profile['E-mail updated'], true);
200:         }200:         }
303: 303: 
304:     if (isset($_POST['form_sent']))304:     if (isset($_POST['form_sent']))
305:     {305:     {
 306:         if (!isset($_FILES['req_file']))
 307:             message($lang_profile['No file']);
 308:             
306:         $uploaded_file = $_FILES['req_file'];309:         $uploaded_file = $_FILES['req_file'];
307: 310: 
308:         // Make sure the upload went smooth311:         // Make sure the upload went smooth
360: 363: 
361:             // Now check the width/height364:             // Now check the width/height
362:             list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');365:             list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
363:             if ($width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])366:             if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
364:             {367:             {
365:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');368:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
366:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');369:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
966:                     <div class="infldset">969:                     <div class="infldset">
967:                         <dl>970:                         <dl>
968:                             <dt><?php echo $lang_profile['Jabber'] ?>: </dt>971:                             <dt><?php echo $lang_profile['Jabber'] ?>: </dt>
969:                             <dd><?php echo ($user['jabber'] !='') ? $user['jabber'] : $lang_profile['Unknown']; ?></dd>972:                             <dd><?php echo ($user['jabber'] !='') ? pun_htmlspecialchars($user['jabber']) : $lang_profile['Unknown']; ?></dd>
970:                             <dt><?php echo $lang_profile['ICQ'] ?>: </dt>973:                             <dt><?php echo $lang_profile['ICQ'] ?>: </dt>
971:                             <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>974:                             <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>
972:                             <dt><?php echo $lang_profile['MSN'] ?>: </dt>975:                             <dt><?php echo $lang_profile['MSN'] ?>: </dt>
1232:                         <legend><?php echo $lang_profile['Contact details legend'] ?></legend>1235:                         <legend><?php echo $lang_profile['Contact details legend'] ?></legend>
1233:                         <div class="infldset">1236:                         <div class="infldset">
1234:                             <input type="hidden" name="form_sent" value="1" />1237:                             <input type="hidden" name="form_sent" value="1" />
1235:                             <label><?php echo $lang_profile['Jabber'] ?><br /><input id="jabber" type="text" name="form[jabber]" value="<?php echo $user['jabber'] ?>" size="40" maxlength="75" /><br /></label>1238:                             <label><?php echo $lang_profile['Jabber'] ?><br /><input id="jabber" type="text" name="form[jabber]" value="<?php echo pun_htmlspecialchars($user['jabber']) ?>" size="40" maxlength="75" /><br /></label>
1236:                             <label><?php echo $lang_profile['ICQ'] ?><br /><input id="icq" type="text" name="form[icq]" value="<?php echo $user['icq'] ?>" size="12" maxlength="12" /><br /></label>1239:                             <label><?php echo $lang_profile['ICQ'] ?><br /><input id="icq" type="text" name="form[icq]" value="<?php echo $user['icq'] ?>" size="12" maxlength="12" /><br /></label>
1237:                             <label><?php echo $lang_profile['MSN'] ?><br /><input id="msn" type="text" name="form[msn]" value="<?php echo pun_htmlspecialchars($user['msn']) ?>" size="40" maxlength="50" /><br /></label>1240:                             <label><?php echo $lang_profile['MSN'] ?><br /><input id="msn" type="text" name="form[msn]" value="<?php echo pun_htmlspecialchars($user['msn']) ?>" size="40" maxlength="50" /><br /></label>
1238:                             <label><?php echo $lang_profile['AOL IM'] ?><br /><input id="aim" type="text" name="form[aim]" value="<?php echo pun_htmlspecialchars($user['aim']) ?>" size="20" maxlength="30" /><br /></label>1241:                             <label><?php echo $lang_profile['AOL IM'] ?><br /><input id="aim" type="text" name="form[aim]" value="<?php echo pun_htmlspecialchars($user['aim']) ?>" size="20" maxlength="30" /><br /></label>


punbb-1.2.2/upload/userlist.php punbb-1.2.5/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)-1 FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE '.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'.(!empty($where_sql) ? ' WHERE u.id>1 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: 
154: <?php154: <?php
155: 155: 
156: // Grab the users156: // Grab the users
157: $result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());157: $result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, 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'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
158: if ($db->num_rows($result))158: if ($db->num_rows($result))
159: {159: {
160:     while ($user_data = $db->fetch_assoc($result))160:     while ($user_data = $db->fetch_assoc($result))


punbb-1.2.2/upload/viewtopic.php punbb-1.2.5/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 DISTINCT 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.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)