| punbb-1.2.4/upload/admin_bans.php |
punbb-1.2.8/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: else | 246: 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 cache | 249: // Regenerate the bans cache |
| 250: require_once PUN_ROOT.'include/cache.php'; | 250: require_once PUN_ROOT.'include/cache.php'; |
| punbb-1.2.4/upload/admin_groups.php |
punbb-1.2.8/upload/admin_groups.php |
| 209: | 209: |
| 210: $title = trim($_POST['req_title']); | 210: $title = trim($_POST['req_title']); |
| 211: $user_title = trim($_POST['user_title']); | 211: $user_title = trim($_POST['user_title']); |
| 212: $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1'; | 212: $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1'; |
| 213: $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1'; | 213: $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1'; |
| 214: $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1'; | 214: $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1'; |
| 215: $edit_posts = isset($_POST['edit_posts']) ? $_POST['edit_posts'] : ($is_admin_group) ? '1' : '0'; | 215: $edit_posts = isset($_POST['edit_posts']) ? intval($_POST['edit_posts']) : ($is_admin_group) ? '1' : '0'; |
| 216: $delete_posts = isset($_POST['delete_posts']) ? $_POST['delete_posts'] : ($is_admin_group) ? '1' : '0'; | 216: $delete_posts = isset($_POST['delete_posts']) ? intval($_POST['delete_posts']) : ($is_admin_group) ? '1' : '0'; |
| 217: $delete_topics = isset($_POST['delete_topics']) ? $_POST['delete_topics'] : ($is_admin_group) ? '1' : '0'; | 217: $delete_topics = isset($_POST['delete_topics']) ? intval($_POST['delete_topics']) : ($is_admin_group) ? '1' : '0'; |
| 218: $set_title = isset($_POST['set_title']) ? $_POST['set_title'] : ($is_admin_group) ? '1' : '0'; | 218: $set_title = isset($_POST['set_title']) ? intval($_POST['set_title']) : ($is_admin_group) ? '1' : '0'; |
| 219: $search = isset($_POST['search']) ? $_POST['search'] : '1'; | 219: $search = isset($_POST['search']) ? intval($_POST['search']) : '1'; |
| 220: $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1'; | 220: $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1'; |
| 221: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; | 221: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; |
| 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; | 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; |
| 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; | 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; |
| 243: } | 243: } |
| 244: else | 244: else |
| 245: { | 245: { |
| 246: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' && g_id!='.$_POST['group_id']) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); | 246: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); |
| 247: if ($db->num_rows($result)) | 247: if ($db->num_rows($result)) |
| 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); | 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
| 249: | 249: |
| 250: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error()); | 250: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error()); |
| 251: } | 251: } |
| 252: | 252: |
| 253: // Regenerate the quickjump cache | 253: // Regenerate the quickjump cache |
| punbb-1.2.4/upload/admin_index.php |
punbb-1.2.8/upload/admin_index.php |
| 86: $load_averages = @explode(' ', $load_averages); | 86: $load_averages = @explode(' ', $load_averages); |
| 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; | 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; |
| 88: } | 88: } |
| 89: else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) | 89: else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) |
| 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; | 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; |
| 91: else | 91: else |
| 92: $server_load = 'Not available'; | 92: $server_load = 'Not available'; |
| 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.4/upload/admin_options.php |
punbb-1.2.8/upload/admin_options.php |
| 117: while (list($key, $input) = @each($form)) | 117: while (list($key, $input) = @each($form)) |
| 118: { | 118: { |
| 119: // Only update values that have changed | 119: // Only update values that have changed |
| 120: if ($pun_config['o_'.$key] != $input) | 120: if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input) |
| 121: { | 121: { |
| 122: if ($input != '' || is_int($input)) | 122: if ($input != '' || is_int($input)) |
| 123: $value = '\''.$db->escape($input).'\''; | 123: $value = '\''.$db->escape($input).'\''; |
| 124: else | 124: 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.4/upload/admin_permissions.php |
punbb-1.2.8/upload/admin_permissions.php |
| 39: { | 39: { |
| 40: confirm_referrer('admin_permissions.php'); | 40: confirm_referrer('admin_permissions.php'); |
| 41: | 41: |
| 42: $form = array_map('trim', $_POST['form']); | 42: $form = array_map('intval', $_POST['form']); |
| 43: | |
| 44: $form['sig_length'] = intval($form['sig_length']); | |
| 45: $form['sig_lines'] = intval($form['sig_lines']); | |
| 46: | 43: |
| 47: while (list($key, $input) = @each($form)) | 44: while (list($key, $input) = @each($form)) |
| 48: { | 45: { |
| 49: // Only update values that have changed | 46: // Only update values that have changed |
| 50: if ($pun_config['p_'.$key] != $input) | 47: if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input) |
| 51: { | 48: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
| 52: if ($input != '' || is_int($input)) | |
| 53: $value = '\''.$db->escape($input).'\''; | |
| 54: else | |
| 55: $value = 'NULL'; | |
| 56: | |
| 57: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'p_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); | |
| 58: } | |
| 59: } | 49: } |
| 60: | 50: |
| 61: // Regenerate the config cache | 51: // Regenerate the config cache |
| punbb-1.2.4/upload/admin_users.php |
punbb-1.2.8/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: <?php | 104: <?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: <?php | 208: <?php |
| 217: | 217: |
| 218: // trim() all elements in $form | 218: // trim() all elements in $form |
| 219: $form = array_map('trim', $form); | 219: $form = array_map('trim', $form); |
| | 220: $conditions = array(); |
| 220: | 221: |
| 221: $posts_greater = trim($_POST['posts_greater']); | 222: $posts_greater = trim($_POST['posts_greater']); |
| 222: $posts_less = trim($_POST['posts_less']); | 223: $posts_less = trim($_POST['posts_less']); |
| 257: while (list($key, $input) = @each($form)) | 258: while (list($key, $input) = @each($form)) |
| 258: { | 259: { |
| 259: if ($input != '') | 260: if ($input != '') |
| 260: $conditions[] = 'u.'.$key.' '.$like_command.' \''.str_replace('*', '%', $input).'\''; | 261: $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\''; |
| 261: } | 262: } |
| 262: | 263: |
| 263: if ($posts_greater != '') | 264: if ($posts_greater != '') |
| 268: if ($user_group != 'all') | 269: if ($user_group != 'all') |
| 269: $conditions[] = 'u.group_id='.$db->escape($user_group); | 270: $conditions[] = 'u.group_id='.$db->escape($user_group); |
| 270: | 271: |
| 271: if (!isset($conditions)) | 272: if (empty($conditions)) |
| 272: message('You didn\'t enter any search terms.'); | 273: message('You didn\'t enter any search terms.'); |
| 273: | 274: |
| 274: | 275: |
| 278: ?> | 279: ?> |
| 279: <div class="linkst"> | 280: <div class="linkst"> |
| 280: <div class="inbox"> | 281: <div class="inbox"> |
| 281: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 282: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 282: </div> | 283: </div> |
| 283: </div> | 284: </div> |
| 284: | 285: |
| 338: | 339: |
| 339: <div class="linksb"> | 340: <div class="linksb"> |
| 340: <div class="inbox"> | 341: <div class="inbox"> |
| 341: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 342: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 342: </div> | 343: </div> |
| 343: </div> | 344: </div> |
| 344: <?php | 345: <?php |
| punbb-1.2.4/upload/edit.php |
punbb-1.2.8/upload/edit.php |
| 175: else if (isset($_POST['preview'])) | 175: else if (isset($_POST['preview'])) |
| 176: { | 176: { |
| 177: require_once PUN_ROOT.'include/parser.php'; | 177: require_once PUN_ROOT.'include/parser.php'; |
| 178: $message = parse_message(trim($_POST['req_message']), $hide_smilies); | 178: $preview_message = parse_message($message, $hide_smilies); |
| 179: | 179: |
| 180: ?> | 180: ?> |
| 181: <div id="postpreview" class="blockpost"> | 181: <div id="postpreview" class="blockpost"> |
| 184: <div class="inbox"> | 184: <div class="inbox"> |
| 185: <div class="postright"> | 185: <div class="postright"> |
| 186: <div class="postmsg"> | 186: <div class="postmsg"> |
| 187: <?php echo $message."\n" ?> | 187: <?php echo $preview_message."\n" ?> |
| 188: </div> | 188: </div> |
| 189: </div> | 189: </div> |
| 190: </div> | 190: </div> |
| 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> | 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> |
| 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> | 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> |
| 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> | 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> |
| 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $_POST['req_message'] : $cur_post['message']) ?></textarea><br /></label> | 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label> |
| 212: <ul class="bblinks"> | 212: <ul class="bblinks"> |
| 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| punbb-1.2.4/upload/extern.php |
punbb-1.2.8/upload/extern.php |
| 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); | 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); |
| 117: | 117: |
| 118: | 118: |
| 119: // Disable error reporting for uninitialized variables | 119: // Make sure PHP reports all errors except E_NOTICE |
| 120: error_reporting(E_ALL); | 120: error_reporting(E_ALL ^ E_NOTICE); |
| 121: | 121: |
| 122: // Turn off magic_quotes_runtime | 122: // Turn off magic_quotes_runtime |
| 123: set_magic_quotes_runtime(0); | 123: set_magic_quotes_runtime(0); |
| 129: // Load DB abstraction layer and try to connect | 129: // 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 config | 132: // 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 forums | 141: // 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.4/upload/include/common.php |
punbb-1.2.8/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 file | 117: // 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 message | 122: // 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.4/upload/include/email.php |
punbb-1.2.8/upload/include/email.php |
| 33: // | 33: // |
| 34: function is_valid_email($email) | 34: function is_valid_email($email) |
| 35: { | 35: { |
| 36: return preg_match('/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{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: // Do a little spring cleaning | 73: // Do a little spring cleaning |
| 71: $to = trim(preg_replace('#[\n\r]+#s', '', $to)); | 74: $to = trim(preg_replace('#[\n\r]+#s', '', $to)); |
| 72: $subject = trim(preg_replace('#[\n\r]+#s', '', $subject)); | 75: $subject = trim(preg_replace('#[\n\r]+#s', '', $subject)); |
| 73: $from = trim(preg_replace('#[\n\r:]+#s', '', $from)); | 76: $from = trim(preg_replace('#[\n\r:]+#s', '', $from)); |
| 74: | 77: |
| 75: // Detect what linebreak we should use for the headers | 78: $headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer'; |
| 76: if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
| 77: $eol = "\r\n"; | |
| 78: else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) | |
| 79: $eol = "\r"; | |
| 80: else | |
| 81: $eol = "\n"; | |
| 82: | |
| 83: $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'; | |
| 84: | 79: |
| 85: // Make sure all linebreaks are CRLF in message | 80: // Make sure all linebreaks are CRLF in message |
| 86: $message = str_replace("\n", "\r\n", pun_linebreaks($message)); | 81: $message = str_replace("\n", "\r\n", pun_linebreaks($message)); |
| 88: if ($pun_config['o_smtp_host'] != '') | 83: if ($pun_config['o_smtp_host'] != '') |
| 89: smtp_mail($to, $subject, $message, $headers); | 84: smtp_mail($to, $subject, $message, $headers); |
| 90: else | 85: else |
| | 86: { |
| | 87: // Change the linebreaks used in the headers according to OS |
| | 88: if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') |
| | 89: $headers = str_replace("\r\n", "\r", $headers); |
| | 90: else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') |
| | 91: $headers = str_replace("\r\n", "\n", $headers); |
| | 92: |
| 91: mail($to, $subject, $message, $headers); | 93: mail($to, $subject, $message, $headers); |
| | 94: } |
| 92: } | 95: } |
| 93: | 96: |
| 94: | 97: |
| punbb-1.2.4/upload/include/functions.php |
punbb-1.2.8/upload/include/functions.php |
| 168: } | 168: } |
| 169: | 169: |
| 170: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) | 170: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) |
| | 171: { |
| | 172: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
| 171: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 173: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| | 174: } |
| 172: | 175: |
| 173: if ($cur_ban['ip'] != '') | 176: if ($cur_ban['ip'] != '') |
| 174: { | 177: { |
| 179: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; | 182: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; |
| 180: | 183: |
| 181: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) | 184: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) |
| | 185: { |
| | 186: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
| 182: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 187: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| | 188: } |
| 183: } | 189: } |
| 184: } | 190: } |
| 185: } | 191: } |
| 203: $now = time(); | 209: $now = time(); |
| 204: | 210: |
| 205: // Fetch all online list entries that are older than "o_timeout_online" | 211: // Fetch all online list entries that are older than "o_timeout_online" |
| 206: $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); | 212: $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to fetch old entries from online list', __FILE__, __LINE__, $db->error()); |
| 207: while ($cur_user = $db->fetch_assoc($result)) | 213: while ($cur_user = $db->fetch_assoc($result)) |
| 208: { | 214: { |
| 209: // If the entry is a guest, delete it | 215: // If the entry is a guest, delete it |
| 803: | 809: |
| 804: | 810: |
| 805: // START SUBST - <pun_include "*"> | 811: // START SUBST - <pun_include "*"> |
| 806: while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include)) | 812: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include)) |
| 807: { | 813: { |
| | 814: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1])) |
| | 815: error('Unable to process user include <pun_include "'.htmlspecialchars($cur_include[1]).'"> from template maintenance.tpl. There is no such file in folder /include/user/'); |
| | 816: |
| 808: ob_start(); | 817: ob_start(); |
| 809: include PUN_ROOT.$cur_include[1]; | 818: include PUN_ROOT.'include/user/'.$cur_include[1]; |
| 810: $tpl_temp = ob_get_contents(); | 819: $tpl_temp = ob_get_contents(); |
| 811: $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint); | 820: $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint); |
| 812: ob_end_clean(); | 821: ob_end_clean(); |
| 813: } | 822: } |
| 814: // END SUBST - <pun_include "*"> | 823: // END SUBST - <pun_include "*"> |
| 854: ob_start(); | 863: ob_start(); |
| 855: | 864: |
| 856: ?> | 865: ?> |
| 857: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" /> | 866: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('<', '>', '"'), $destination_url) ?>" /> |
| 858: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> | 867: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> |
| 859: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> | 868: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> |
| 860: <?php | 869: <?php |
| 893: | 902: |
| 894: | 903: |
| 895: // START SUBST - <pun_include "*"> | 904: // START SUBST - <pun_include "*"> |
| 896: while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include)) | 905: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_redir, $cur_include)) |
| 897: { | 906: { |
| | 907: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1])) |
| | 908: error('Unable to process user include <pun_include "'.htmlspecialchars($cur_include[1]).'"> from template redirect.tpl. There is no such file in folder /include/user/'); |
| | 909: |
| 898: ob_start(); | 910: ob_start(); |
| 899: include PUN_ROOT.$cur_include[1]; | 911: include PUN_ROOT.'include/user/'.$cur_include[1]; |
| 900: $tpl_temp = ob_get_contents(); | 912: $tpl_temp = ob_get_contents(); |
| 901: $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir); | 913: $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir); |
| 902: ob_end_clean(); | 914: ob_end_clean(); |
| 903: } | 915: } |
| 904: // END SUBST - <pun_include "*"> | 916: // END SUBST - <pun_include "*"> |
| punbb-1.2.4/upload/include/parser.php |
punbb-1.2.8/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: { |
| 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, $c_start+6), '[code]'); |
| | 188: if ($tmp2 !== false) |
| | 189: $tmp2 += $c_start+6; |
| | 190: |
| | 191: if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp)) |
| 187: { | 192: { |
| 188: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; | 193: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; |
| 189: return; | 194: return; |
| 259: { | 264: { |
| 260: global $pun_user; | 265: global $pun_user; |
| 261: | 266: |
| 262: $full_url = str_replace(' ', '%20', $url); | 267: $full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url); |
| 263: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// | 268: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// |
| 264: $full_url = 'http://'.$full_url; | 269: $full_url = 'http://'.$full_url; |
| 265: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// | 270: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// |
| 299: { | 304: { |
| 300: global $lang_common, $pun_user; | 305: global $lang_common, $pun_user; |
| 301: | 306: |
| | 307: if (strpos($text, 'quote') !== false) |
| | 308: { |
| | 309: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); |
| | 310: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); |
| | 311: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); |
| | 312: } |
| | 313: |
| 302: $pattern = array('#\[b\](.*?)\[/b\]#s', | 314: $pattern = array('#\[b\](.*?)\[/b\]#s', |
| 303: '#\[i\](.*?)\[/i\]#s', | 315: '#\[i\](.*?)\[/i\]#s', |
| 304: '#\[u\](.*?)\[/u\]#s', | 316: '#\[u\](.*?)\[/u\]#s', |
| 305: '#\[url\](.*?)\[/url\]#e', | 317: '#\[url\]([^\[]*?)\[/url\]#e', |
| 306: '#\[url=(.*?)\](.*?)\[/url\]#e', | 318: '#\[url=([^\[]*?)\](.*?)\[/url\]#e', |
| 307: '#\[email\](.*?)\[/email\]#', | 319: '#\[email\]([^\[]*?)\[/email\]#', |
| 308: '#\[email=(.*?)\](.*?)\[/email\]#', | 320: '#\[email=([^\[]*?)\](.*?)\[/email\]#', |
| 309: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); | 321: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); |
| 310: | 322: |
| 311: $replace = array('<strong>$1</strong>', | 323: $replace = array('<strong>$1</strong>', |
| 319: | 331: |
| 320: // This thing takes a while! :) | 332: // This thing takes a while! :) |
| 321: $text = preg_replace($pattern, $replace, $text); | 333: $text = preg_replace($pattern, $replace, $text); |
| 322: | |
| 323: if (strpos($text, 'quote') !== false) | |
| 324: { | |
| 325: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); | |
| 326: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); | |
| 327: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); | |
| 328: } | |
| 329: | 334: |
| 330: return $text; | 335: return $text; |
| 331: } | 336: } |
| punbb-1.2.4/upload/include/search_idx.php |
punbb-1.2.8/upload/include/search_idx.php |
| 43: | 43: |
| 44: if (empty($noise_match)) | 44: if (empty($noise_match)) |
| 45: { | 45: { |
| 46: $noise_match = array('quote', 'code', 'url', 'img', 'email', 'color', 'colour', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); | 46: $noise_match = array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); |
| 47: $noise_replace = array('', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); | 47: $noise_replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); |
| 48: | 48: |
| 49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); | 49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); |
| 50: $stopwords = array_map('trim', $stopwords); | 50: $stopwords = array_map('trim', $stopwords); |