Loads'a changes including fix for security issue, thanks to Matthijs for checking this out and confirming

git-svn-id: file:///svn/phpbb/trunk@2305 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-03-18 13:35:43 +00:00
parent 502e4aceea
commit e22ee22470
16 changed files with 332 additions and 2158 deletions

View file

@ -0,0 +1,51 @@
<?php
//
// phpBB 2.x auto-generated config file
// Do not change anything in this file!
//
$dbms = "mysql4";
$dbhost = "localhost";
$dbname = "dev_starstreak_net";
$dbuser = "devhttp";
$dbpasswd = "efx2KarizonaD";
$dbhost = "localhost";
$dbname = "phpbb_com";
$dbuser = "devhttp";
$dbpasswd = "efx2KarizonaD";
/*
$dbhost = "localhost";
$dbname = "phpbb_test";
$dbuser = "devhttp";
$dbpasswd = "efx2KarizonaD";
$dbms = "mssql-odbc";
$dbhost = "mssql_phpbb_odbc";
$dbname = "";
$dbuser = "phpbb";
$dbpasswd = "efx2000";
$dbms = "msaccess";
$dbhost = "phpbb_test_msaccess_odbc";
$dbname = "";
$dbuser = "devhttp";
$dbpasswd = "efx2KarizonaD";
$dbms = "mssql";
$dbhost = "localhost";
$dbname = "phpbb";
$dbuser = "phpbb";
$dbpasswd = "efx2000";
*/
$table_prefix = "phpbb_";
define('PHPBB_INSTALLED', true);
?>

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -22,8 +22,10 @@
error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
define('IN_PHPBB', true);
$phpbb_root_path='./'; $phpbb_root_path='./';
include($phpbb_root_path.'extension.inc'); include($phpbb_root_path.'extension.inc');
include($phpbb_root_dir . 'includes/functions_selects.'.$phpEx);
$userdata = array(); $userdata = array();
$lang = array(); $lang = array();

View file

@ -26,6 +26,7 @@
// //
define("IN_LOGIN", true); define("IN_LOGIN", true);
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -19,6 +19,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -29,11 +29,13 @@
* topics via the moderator operations buttons on all of the viewtopic pages. * topics via the moderator operations buttons on all of the viewtopic pages.
*/ */
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/search.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
// //
// Obtain initial var settings // Obtain initial var settings

View file

@ -20,12 +20,12 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/post.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/search.'.$phpEx); include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
// //
// Check and set various parameters // Check and set various parameters
@ -40,7 +40,7 @@ while( list($var, $param) = @each($params) )
} }
else else
{ {
$$var = ""; $$var = '';
} }
} }
@ -55,14 +55,14 @@ $topic_type = ( !empty($HTTP_POST_VARS['topictype']) ) ? $HTTP_POST_VARS['topict
// If the mode is set to topic review then output // If the mode is set to topic review then output
// that review ... // that review ...
// //
if( $mode == "topicreview" ) if( $mode == 'topicreview' )
{ {
require($phpbb_root_path . 'includes/topic_review.'.$phpEx); require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
topic_review($topic_id, false); topic_review($topic_id, false);
exit; exit;
} }
else if( $mode == "smilies" ) else if( $mode == 'smilies' )
{ {
generate_smilies("window", PAGE_POSTING); generate_smilies("window", PAGE_POSTING);
exit; exit;
@ -95,7 +95,7 @@ if( isset($HTTP_POST_VARS['cancel']) )
$post_append = ""; $post_append = "";
} }
header("Location: " . append_sid($redirect) . $post_append, true); header('Location: ' . append_sid($redirect) . $post_append, true);
} }
// //
@ -116,33 +116,33 @@ switch( $mode )
case 'newtopic': case 'newtopic':
if( $topic_type == POST_ANNOUNCE ) if( $topic_type == POST_ANNOUNCE )
{ {
$is_auth_type = "auth_announce"; $is_auth_type = 'auth_announce';
} }
else if( $topic_type == POST_STICKY ) else if( $topic_type == POST_STICKY )
{ {
$is_auth_type = "auth_sticky"; $is_auth_type = 'auth_sticky';
} }
else else
{ {
$is_auth_type = "auth_post"; $is_auth_type = 'auth_post';
} }
break; break;
case 'reply': case 'reply':
case 'quote': case 'quote':
$is_auth_type = "auth_reply"; $is_auth_type = 'auth_reply';
break; break;
case 'editpost': case 'editpost':
$is_auth_type = "auth_edit"; $is_auth_type = 'auth_edit';
break; break;
case 'delete': case 'delete':
case 'poll_delete': case 'poll_delete':
$is_auth_type = "auth_delete"; $is_auth_type = 'auth_delete';
break; break;
case 'vote': case 'vote':
$is_auth_type = "auth_vote"; $is_auth_type = 'auth_vote';
break; break;
case 'topicreview': case 'topicreview':
$is_auth_type = "auth_read"; $is_auth_type = 'auth_read';
break; break;
default: default:
message_die(GENERAL_MESSAGE, $lang['No_post_mode']); message_die(GENERAL_MESSAGE, $lang['No_post_mode']);
@ -153,7 +153,7 @@ switch( $mode )
// Here we do various lookups to find topic_id, forum_id, post_id etc. // Here we do various lookups to find topic_id, forum_id, post_id etc.
// Doing it here prevents spoofing (eg. faking forum_id, topic_id or post_id // Doing it here prevents spoofing (eg. faking forum_id, topic_id or post_id
// //
$error_msg = ""; $error_msg = '';
$post_data = array(); $post_data = array();
switch ( $mode ) switch ( $mode )
{ {
@ -219,12 +219,12 @@ if ( $result = $db->sql_query($sql) )
{ {
message_die(GENERAL_MESSAGE, $lang['Forum_locked']); message_die(GENERAL_MESSAGE, $lang['Forum_locked']);
} }
else if ( $mode != "newtopic" && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])
{ {
message_die(GENERAL_MESSAGE, $lang['Topic_locked']); message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
} }
if ( $mode == "editpost" || $mode == "delete" || $mode == "poll_delete" ) if ( $mode == 'editpost' || $mode == 'delete' || $mode == 'poll_delete' )
{ {
$topic_id = $post_info['topic_id']; $topic_id = $post_info['topic_id'];
@ -292,12 +292,12 @@ if ( $result = $db->sql_query($sql) )
} }
else else
{ {
if ( $mode == "quote" ) if ( $mode == 'quote' )
{ {
$topic_id = $post_info['topic_id']; $topic_id = $post_info['topic_id'];
} }
$post_data['first_post'] = ( $mode == "newtopic" ) ? true : 0; $post_data['first_post'] = ( $mode == 'newtopic' ) ? true : 0;
$post_data['last_post'] = false; $post_data['last_post'] = false;
$post_data['has_poll'] = false; $post_data['has_poll'] = false;
$post_data['edit_poll'] = false; $post_data['edit_poll'] = false;
@ -374,7 +374,7 @@ if ( $submit || $refresh )
} }
else else
{ {
if ( $mode != "newtopic" ) if ( $mode != 'newtopic' )
{ {
$sql = "SELECT topic_id $sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . " FROM " . TOPICS_WATCH_TABLE . "
@ -406,7 +406,7 @@ if ( ( $delete || $poll_delete || $mode == "delete" ) && !$confirm )
$s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />'; $s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
$s_hidden_fields .= ( $delete || $mode == "delete" ) ? '<input type="hidden" name="mode" value="delete" />' : '<input type="hidden" name="mode" value="poll_delete" />'; $s_hidden_fields .= ( $delete || $mode == "delete" ) ? '<input type="hidden" name="mode" value="delete" />' : '<input type="hidden" name="mode" value="poll_delete" />';
$l_confirm = ( $delete || $mode == "delete" ) ? $lang['Confirm_delete'] : $lang['Confirm_delete_poll']; $l_confirm = ( $delete || $mode == 'delete' ) ? $lang['Confirm_delete'] : $lang['Confirm_delete_poll'];
// //
// Output confirmation page // Output confirmation page
@ -414,25 +414,25 @@ if ( ( $delete || $poll_delete || $mode == "delete" ) && !$confirm )
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(
"confirm_body" => "confirm_body.tpl") 'confirm_body' => 'confirm_body.tpl')
); );
$template->assign_vars(array( $template->assign_vars(array(
"MESSAGE_TITLE" => $lang['Information'], 'MESSAGE_TITLE' => $lang['Information'],
"MESSAGE_TEXT" => $l_confirm, 'MESSAGE_TEXT' => $l_confirm,
"L_YES" => $lang['Yes'], 'L_YES' => $lang['Yes'],
"L_NO" => $lang['No'], 'L_NO' => $lang['No'],
"S_CONFIRM_ACTION" => append_sid("posting.$phpEx"), 'S_CONFIRM_ACTION' => append_sid("posting.$phpEx"),
"S_HIDDEN_FIELDS" => $s_hidden_fields) 'S_HIDDEN_FIELDS' => $s_hidden_fields)
); );
$template->pparse("confirm_body"); $template->pparse('confirm_body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
} }
else if ( $mode == "vote" ) else if ( $mode == 'vote' )
{ {
// //
// Vote in a poll // Vote in a poll
@ -496,7 +496,7 @@ else if ( $mode == "vote" )
} }
$template->assign_vars(array( $template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
); );
$message .= '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); $message .= '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
@ -507,26 +507,25 @@ else if ( $submit || $confirm )
// //
// Submit post/vote (newtopic, edit, reply, etc.) // Submit post/vote (newtopic, edit, reply, etc.)
// //
$return_message = ""; $return_message = '';
$return_meta = ""; $return_meta = '';
switch ( $mode ) switch ( $mode )
{ {
case 'editpost': case 'editpost':
case 'newtopic': case 'newtopic':
case 'reply': case 'reply':
$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : ""; $username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? $HTTP_POST_VARS['subject'] : ""; $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? $HTTP_POST_VARS['subject'] : '';
$message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : ""; $message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : '';
$poll_title = ( isset($HTTP_POST_VARS['poll_title']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_title'] : ""; $poll_title = ( isset($HTTP_POST_VARS['poll_title']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_title'] : '';
$poll_options = ( isset($HTTP_POST_VARS['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_option_text'] : ""; $poll_options = ( isset($HTTP_POST_VARS['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_option_text'] : '';
$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : ""; $poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';
$bbcode_uid = ""; $bbcode_uid = '';
prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length); prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
if ( $error_msg == "" ) if ( $error_msg == '' )
{ {
$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type; $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
@ -541,12 +540,17 @@ else if ( $submit || $confirm )
break; break;
} }
if ( $error_msg == "" ) if ( $mode != 'editpost' )
{ {
if ( $mode == "newtopic" || $mode == "reply" ) update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $post_data['poster_id']);
}
if ( $error_msg == '' )
{
if ( $mode == 'newtopic' || $mode == 'reply' )
{ {
$tracking_topics = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array(); $tracking_topics = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array(); $tracking_forums = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
if ( count($tracking_topics) + count($tracking_forums) == 100 && empty($tracking_topics[$topic_id]) ) if ( count($tracking_topics) + count($tracking_forums) == 100 && empty($tracking_topics[$topic_id]) )
{ {
@ -556,7 +560,7 @@ else if ( $submit || $confirm )
$tracking_topics[$topic_id] = time(); $tracking_topics[$topic_id] = time();
setcookie($board_config['cookie_name'] . "_t", serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
} }
$template->assign_vars(array( $template->assign_vars(array(
@ -566,16 +570,13 @@ else if ( $submit || $confirm )
} }
} }
// if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' )
//
//
if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
{ {
$username = ( !empty($HTTP_POST_VARS['username']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['username']))) : ""; $username = ( !empty($HTTP_POST_VARS['username']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['username']))) : '';
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : ""; $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : '';
$message = ( !empty($HTTP_POST_VARS['message']) ) ? trim(stripslashes($HTTP_POST_VARS['message'])) : ""; $message = ( !empty($HTTP_POST_VARS['message']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';
$poll_title = ( !empty($HTTP_POST_VARS['poll_title']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['poll_title']))) : ""; $poll_title = ( !empty($HTTP_POST_VARS['poll_title']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['poll_title']))) : '';
$poll_length = ( isset($HTTP_POST_VARS['poll_length']) ) ? max(0, intval($HTTP_POST_VARS['poll_length'])) : 0; $poll_length = ( isset($HTTP_POST_VARS['poll_length']) ) ? max(0, intval($HTTP_POST_VARS['poll_length'])) : 0;
$poll_options = array(); $poll_options = array();
@ -601,11 +602,11 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
if ( $mode == 'newtopic' || $mode == 'reply') if ( $mode == 'newtopic' || $mode == 'reply')
{ {
$user_sig = ( $userdata['user_sig'] != "" ) ? $userdata['user_sig'] : ""; $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';
} }
else if ( $mode == 'editpost' ) else if ( $mode == 'editpost' )
{ {
$user_sig = ( $post_info['user_sig'] != "" ) ? $post_info['user_sig'] : ""; $user_sig = ( $post_info['user_sig'] != '' ) ? $post_info['user_sig'] : '';
} }
if( $preview ) if( $preview )
@ -614,8 +615,8 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
$replacement_word = array(); $replacement_word = array();
obtain_word_list($orig_word, $replacement_word); obtain_word_list($orig_word, $replacement_word);
$bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ""; $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : '';
$preview_message = stripslashes(prepare_message(addslashes($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); $preview_message = stripslashes(prepare_message(addslashes(unprepare_message($message)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid));
$preview_subject = $subject; $preview_subject = $subject;
$preview_username = $username; $preview_username = $username;
@ -624,13 +625,13 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
// //
if( !$html_on ) if( !$html_on )
{ {
if( $user_sig != "" || !$userdata['user_allowhtml'] ) if( $user_sig != '' || !$userdata['user_allowhtml'] )
{ {
$user_sig = preg_replace("#(<)([\/]?.*?)(>)#is", "&lt;\\2&gt;", $user_sig); $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\2&gt;', $user_sig);
} }
} }
if( $attach_sig && $user_sig != "" && $userdata['user_sig_bbcode_uid'] ) if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] )
{ {
$user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']); $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']);
} }
@ -642,12 +643,12 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
if( !empty($orig_word) ) if( !empty($orig_word) )
{ {
$preview_username = ( !empty($username) ) ? preg_replace($orig_word, $replacement_word, $preview_username) : ""; $preview_username = ( !empty($username) ) ? preg_replace($orig_word, $replacement_word, $preview_username) : '';
$preview_subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $preview_subject) : ""; $preview_subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $preview_subject) : '';
$preview_message = ( !empty($preview_message) ) ? preg_replace($orig_word, $replacement_word, $preview_message) : ""; $preview_message = ( !empty($preview_message) ) ? preg_replace($orig_word, $replacement_word, $preview_message) : '';
} }
if( $user_sig != "" ) if( $user_sig != '' )
{ {
$user_sig = make_clickable($user_sig); $user_sig = make_clickable($user_sig);
} }
@ -655,7 +656,7 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
if( $smilies_on ) if( $smilies_on )
{ {
if( $userdata['user_allowsmile'] && $user_sig != "" ) if( $userdata['user_allowsmile'] && $user_sig != '' )
{ {
$user_sig = smilies_pass($user_sig); $user_sig = smilies_pass($user_sig);
} }
@ -663,39 +664,39 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != "" )
$preview_message = smilies_pass($preview_message); $preview_message = smilies_pass($preview_message);
} }
if( $attach_sig && $user_sig != "" ) if( $attach_sig && $user_sig != '' )
{ {
$preview_message = $preview_message . "<br /><br />_________________<br />" . $user_sig; $preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig;
} }
$preview_message = str_replace("\n", "<br />", $preview_message); $preview_message = str_replace("\n", '<br />', $preview_message);
$template->set_filenames(array( $template->set_filenames(array(
"preview" => "posting_preview.tpl") 'preview' => 'posting_preview.tpl')
); );
$template->assign_vars(array( $template->assign_vars(array(
"TOPIC_TITLE" => $preview_subject, 'TOPIC_TITLE' => $preview_subject,
"POST_SUBJECT" => $preview_subject, 'POST_SUBJECT' => $preview_subject,
"POSTER_NAME" => $preview_username, 'POSTER_NAME' => $preview_username,
"POST_DATE" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), 'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
"MESSAGE" => $preview_message, 'MESSAGE' => $preview_message,
"L_POST_SUBJECT" => $lang['Post_subject'], 'L_POST_SUBJECT' => $lang['Post_subject'],
"L_PREVIEW" => $lang['Preview'], 'L_PREVIEW' => $lang['Preview'],
"L_POSTED" => $lang['Posted']) 'L_POSTED' => $lang['Posted'])
); );
$template->assign_var_from_handle("POST_PREVIEW_BOX", "preview"); $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview');
} }
else if( $error_msg != "" ) else if( $error_msg != '' )
{ {
$template->set_filenames(array( $template->set_filenames(array(
"reg_header" => "error_body.tpl") 'reg_header' => 'error_body.tpl')
); );
$template->assign_vars(array( $template->assign_vars(array(
"ERROR_MESSAGE" => $error_msg) 'ERROR_MESSAGE' => $error_msg)
); );
$template->assign_var_from_handle("ERROR_BOX", "reg_header"); $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
} }
} }
else else
@ -705,21 +706,21 @@ else
// //
if ( $mode == 'newtopic' ) if ( $mode == 'newtopic' )
{ {
$user_sig = ( $userdata['user_sig'] != "" ) ? $userdata['user_sig'] : ""; $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';
$username = ($userdata['session_logged_in']) ? $userdata['username'] : ""; $username = ($userdata['session_logged_in']) ? $userdata['username'] : '';
$poll_title = ""; $poll_title = '';
$poll_length = ""; $poll_length = '';
$subject = ""; $subject = '';
$message = ""; $message = '';
} }
else if ( $mode == 'reply' ) else if ( $mode == 'reply' )
{ {
$user_sig = ( $userdata['user_sig'] != "" ) ? $userdata['user_sig'] : ""; $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';
$username = ( $userdata['session_logged_in'] ) ? $userdata['username'] : ""; $username = ( $userdata['session_logged_in'] ) ? $userdata['username'] : '';
$subject = ""; $subject = '';
$message = ""; $message = '';
} }
else if ( $mode == 'quote' || $mode == 'editpost' ) else if ( $mode == 'quote' || $mode == 'editpost' )
@ -727,9 +728,9 @@ else
$subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject']; $subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject'];
$message = $post_info['post_text']; $message = $post_info['post_text'];
if ( $mode == "editpost" ) if ( $mode == 'editpost' )
{ {
$attach_sig = ( $post_info['enable_sig'] && $post_info['user_sig'] != "" ) ? TRUE : 0; $attach_sig = ( $post_info['enable_sig'] && $post_info['user_sig'] != '' ) ? TRUE : 0;
$user_sig = $post_info['user_sig']; $user_sig = $post_info['user_sig'];
$html_on = ( $post_info['enable_html'] ) ? true : false; $html_on = ( $post_info['enable_html'] ) ? true : false;
@ -742,12 +743,14 @@ else
$user_sig = $userdata['user_sig']; $user_sig = $userdata['user_sig'];
} }
if ( $post_info['bbcode_uid'] != "" ) if ( $post_info['bbcode_uid'] != '' )
{ {
$message = preg_replace("/\:(([a-z0-9]:)?)" . $post_info['bbcode_uid'] . "/si", "", $message); $message = preg_replace('/\:(([a-z0-9]:)?)' . $post_info['bbcode_uid'] . '/s', '', $message);
} }
$message = str_replace("<br />", "\n", $message);
$message = preg_replace('#</textarea>#si', '&lt;/textarea&gt;', $message); $message = str_replace('<', '&lt;', $message);
$message = str_replace('>', '&gt;', $message);
$message = str_replace('<br />', "\n", $message);
if ( $mode == 'quote' ) if ( $mode == 'quote' )
{ {
@ -761,11 +764,11 @@ else
if ( !empty($orig_word) ) if ( !empty($orig_word) )
{ {
$subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : ""; $subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : '';
$message = ( !empty($message) ) ? preg_replace($orig_word, $replace_word, $message) : ""; $message = ( !empty($message) ) ? preg_replace($orig_word, $replace_word, $message) : '';
} }
if ( !preg_match("/^Re:/", $subject) && strlen($subject) > 0 ) if ( !preg_match('/^Re:/', $subject) && strlen($subject) > 0 )
{ {
$subject = 'Re: ' . $subject; $subject = 'Re: ' . $subject;
} }
@ -774,7 +777,7 @@ else
} }
else else
{ {
$username = ( $post_info['user_id'] == ANONYMOUS && !empty($post_info['post_username']) ) ? $post_info['post_username'] : ""; $username = ( $post_info['user_id'] == ANONYMOUS && !empty($post_info['post_username']) ) ? $post_info['post_username'] : '';
} }
} }
} }
@ -784,7 +787,7 @@ else
// //
if( $user_sig != '' ) if( $user_sig != '' )
{ {
$template->assign_block_vars("signature_checkbox", array()); $template->assign_block_vars('signature_checkbox', array());
} }
// //
@ -793,7 +796,7 @@ if( $user_sig != '' )
if ( $board_config['allow_html'] ) if ( $board_config['allow_html'] )
{ {
$html_status = $lang['HTML_is_ON']; $html_status = $lang['HTML_is_ON'];
$template->assign_block_vars("html_checkbox", array()); $template->assign_block_vars('html_checkbox', array());
} }
else else
{ {
@ -806,7 +809,7 @@ else
if ( $board_config['allow_bbcode'] ) if ( $board_config['allow_bbcode'] )
{ {
$bbcode_status = $lang['BBCode_is_ON']; $bbcode_status = $lang['BBCode_is_ON'];
$template->assign_block_vars("bbcode_checkbox", array()); $template->assign_block_vars('bbcode_checkbox', array());
} }
else else
{ {
@ -819,16 +822,16 @@ else
if ( $board_config['allow_smilies'] ) if ( $board_config['allow_smilies'] )
{ {
$smilies_status = $lang['Smilies_are_ON']; $smilies_status = $lang['Smilies_are_ON'];
$template->assign_block_vars("smilies_checkbox", array()); $template->assign_block_vars('smilies_checkbox', array());
} }
else else
{ {
$smilies_status = $lang['Smilies_are_OFF']; $smilies_status = $lang['Smilies_are_OFF'];
} }
if( !$userdata['session_logged_in'] || ( $mode == "editpost" && $post_info['poster_id'] == ANONYMOUS ) ) if( !$userdata['session_logged_in'] || ( $mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS ) )
{ {
$template->assign_block_vars("username_select", array()); $template->assign_block_vars('username_select', array());
} }
// //
@ -836,9 +839,9 @@ if( !$userdata['session_logged_in'] || ( $mode == "editpost" && $post_info['post
// //
if ( $userdata['session_logged_in'] ) if ( $userdata['session_logged_in'] )
{ {
if ( $mode != "editpost" || ( $mode == "editpost" && $post_info['poster_id'] != ANONYMOUS ) ) if ( $mode != 'editpost' || ( $mode == 'editpost' && $post_info['poster_id'] != ANONYMOUS ) )
{ {
$template->assign_block_vars("notify_checkbox", array()); $template->assign_block_vars('notify_checkbox', array());
} }
} }
@ -847,7 +850,7 @@ if ( $userdata['session_logged_in'] )
// //
if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) ) if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) )
{ {
$template->assign_block_vars("delete_checkbox", array()); $template->assign_block_vars('delete_checkbox', array());
} }
// //
@ -856,7 +859,7 @@ if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post
$topic_type_toggle = ''; $topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{ {
$template->assign_block_vars("type_toggle", array()); $template->assign_block_vars('type_toggle', array());
if( $is_auth['auth_sticky'] ) if( $is_auth['auth_sticky'] )
{ {
@ -878,7 +881,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
$topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;'; $topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;';
} }
if ( $topic_type_toggle != "" ) if ( $topic_type_toggle != '' )
{ {
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle; $topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle;
} }
@ -913,158 +916,158 @@ generate_smilies("inline", PAGE_POSTING);
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(
"body" => "posting_body.tpl", 'body' => 'posting_body.tpl',
"pollbody" => "posting_poll_body.tpl", 'pollbody' => 'posting_poll_body.tpl',
"jumpbox" => "jumpbox.tpl", 'jumpbox' => 'jumpbox.tpl',
"reviewbody" => "posting_topic_review.tpl") 'reviewbody' => 'posting_topic_review.tpl')
); );
$jumpbox = make_jumpbox(); $jumpbox = make_jumpbox();
$template->assign_vars(array( $template->assign_vars(array(
"L_GO" => $lang['Go'], 'L_GO' => $lang['Go'],
"L_JUMP_TO" => $lang['Jump_to'], 'L_JUMP_TO' => $lang['Jump_to'],
"L_SELECT_FORUM" => $lang['Select_forum'], 'L_SELECT_FORUM' => $lang['Select_forum'],
"S_JUMPBOX_LIST" => $jumpbox, 'S_JUMPBOX_LIST' => $jumpbox,
"S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx")) 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
); );
$template->assign_var_from_handle("JUMPBOX", "jumpbox"); $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
$template->assign_vars(array( $template->assign_vars(array(
"FORUM_NAME" => $forum_name, 'FORUM_NAME' => $forum_name,
"L_POST_A" => $page_title, 'L_POST_A' => $page_title,
"L_POST_SUBJECT" => $lang['Post_subject'], 'L_POST_SUBJECT' => $lang['Post_subject'],
"U_VIEW_FORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id")) 'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
); );
// //
// This enables the forum/topic title to be output for posting // This enables the forum/topic title to be output for posting
// but not for privmsg (where it makes no sense) // but not for privmsg (where it makes no sense)
// //
$template->assign_block_vars("switch_not_privmsg", array()); $template->assign_block_vars('switch_not_privmsg', array());
// //
// Output the data to the template // Output the data to the template
// //
$template->assign_vars(array( $template->assign_vars(array(
"USERNAME" => $username, 'USERNAME' => $username,
"SUBJECT" => $subject, 'SUBJECT' => $subject,
"MESSAGE" => $message, 'MESSAGE' => $message,
"HTML_STATUS" => $html_status, 'HTML_STATUS' => $html_status,
"BBCODE_STATUS" => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
"SMILIES_STATUS" => $smilies_status, 'SMILIES_STATUS' => $smilies_status,
"L_SUBJECT" => $lang['Subject'], 'L_SUBJECT' => $lang['Subject'],
"L_MESSAGE_BODY" => $lang['Message_body'], 'L_MESSAGE_BODY' => $lang['Message_body'],
"L_OPTIONS" => $lang['Options'], 'L_OPTIONS' => $lang['Options'],
"L_PREVIEW" => $lang['Preview'], 'L_PREVIEW' => $lang['Preview'],
"L_SPELLCHECK" => $lang['Spellcheck'], 'L_SPELLCHECK' => $lang['Spellcheck'],
"L_SUBMIT" => $lang['Submit'], 'L_SUBMIT' => $lang['Submit'],
"L_CANCEL" => $lang['Cancel'], 'L_CANCEL' => $lang['Cancel'],
"L_CONFIRM_DELETE" => $lang['Confirm_delete'], 'L_CONFIRM_DELETE' => $lang['Confirm_delete'],
"L_DISABLE_HTML" => $lang['Disable_HTML_post'], 'L_DISABLE_HTML' => $lang['Disable_HTML_post'],
"L_DISABLE_BBCODE" => $lang['Disable_BBCode_post'], 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'],
"L_DISABLE_SMILIES" => $lang['Disable_Smilies_post'], 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'],
"L_ATTACH_SIGNATURE" => $lang['Attach_signature'], 'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
"L_NOTIFY_ON_REPLY" => $lang['Notify'], 'L_NOTIFY_ON_REPLY' => $lang['Notify'],
"L_DELETE_POST" => $lang['Delete_post'], 'L_DELETE_POST' => $lang['Delete_post'],
"L_BBCODE_B_HELP" => $lang['bbcode_b_help'], 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
"L_BBCODE_I_HELP" => $lang['bbcode_i_help'], 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
"L_BBCODE_U_HELP" => $lang['bbcode_u_help'], 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
"L_BBCODE_Q_HELP" => $lang['bbcode_q_help'], 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
"L_BBCODE_C_HELP" => $lang['bbcode_c_help'], 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
"L_BBCODE_L_HELP" => $lang['bbcode_l_help'], 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
"L_BBCODE_O_HELP" => $lang['bbcode_o_help'], 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
"L_BBCODE_P_HELP" => $lang['bbcode_p_help'], 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
"L_BBCODE_W_HELP" => $lang['bbcode_w_help'], 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
"L_BBCODE_A_HELP" => $lang['bbcode_a_help'], 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
"L_BBCODE_S_HELP" => $lang['bbcode_s_help'], 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
"L_BBCODE_F_HELP" => $lang['bbcode_f_help'], 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
"L_EMPTY_MESSAGE" => $lang['Empty_message'], 'L_EMPTY_MESSAGE' => $lang['Empty_message'],
"L_FONT_COLOR" => $lang['Font_color'], 'L_FONT_COLOR' => $lang['Font_color'],
"L_COLOR_DEFAULT" => $lang['color_default'], 'L_COLOR_DEFAULT' => $lang['color_default'],
"L_COLOR_DARK_RED" => $lang['color_dark_red'], 'L_COLOR_DARK_RED' => $lang['color_dark_red'],
"L_COLOR_RED" => $lang['color_red'], 'L_COLOR_RED' => $lang['color_red'],
"L_COLOR_ORANGE" => $lang['color_orange'], 'L_COLOR_ORANGE' => $lang['color_orange'],
"L_COLOR_BROWN" => $lang['color_brown'], 'L_COLOR_BROWN' => $lang['color_brown'],
"L_COLOR_YELLOW" => $lang['color_yellow'], 'L_COLOR_YELLOW' => $lang['color_yellow'],
"L_COLOR_GREEN" => $lang['color_green'], 'L_COLOR_GREEN' => $lang['color_green'],
"L_COLOR_OLIVE" => $lang['color_olive'], 'L_COLOR_OLIVE' => $lang['color_olive'],
"L_COLOR_CYAN" => $lang['color_cyan'], 'L_COLOR_CYAN' => $lang['color_cyan'],
"L_COLOR_BLUE" => $lang['color_blue'], 'L_COLOR_BLUE' => $lang['color_blue'],
"L_COLOR_DARK_BLUE" => $lang['color_dark_blue'], 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
"L_COLOR_INDIGO" => $lang['color_indigo'], 'L_COLOR_INDIGO' => $lang['color_indigo'],
"L_COLOR_VIOLET" => $lang['color_violet'], 'L_COLOR_VIOLET' => $lang['color_violet'],
"L_COLOR_WHITE" => $lang['color_white'], 'L_COLOR_WHITE' => $lang['color_white'],
"L_COLOR_BLACK" => $lang['color_black'], 'L_COLOR_BLACK' => $lang['color_black'],
"L_FONT_SIZE" => $lang['Font_size'], 'L_FONT_SIZE' => $lang['Font_size'],
"L_FONT_TINY" => $lang['font_tiny'], 'L_FONT_TINY' => $lang['font_tiny'],
"L_FONT_SMALL" => $lang['font_small'], 'L_FONT_SMALL' => $lang['font_small'],
"L_FONT_NORMAL" => $lang['font_normal'], 'L_FONT_NORMAL' => $lang['font_normal'],
"L_FONT_LARGE" => $lang['font_large'], 'L_FONT_LARGE' => $lang['font_large'],
"L_FONT_HUGE" => $lang['font_huge'], 'L_FONT_HUGE' => $lang['font_huge'],
"L_BBCODE_CLOSE_TAGS" => $lang['Close_Tags'], 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
"L_STYLES_TIP" => $lang['Styles_tip'], 'L_STYLES_TIP' => $lang['Styles_tip'],
"U_VIEWTOPIC" => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postorder=desc") : "", 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postorder=desc") : '',
"U_REVIEW_TOPIC" => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&amp;" . POST_TOPIC_URL . "=$topic_id") : "", 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&amp;" . POST_TOPIC_URL . "=$topic_id") : '',
"S_HTML_CHECKED" => ( !$html_on ) ? 'checked="checked"' : "", 'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '',
"S_BBCODE_CHECKED" => ( !$bbcode_on ) ? 'checked="checked"' : "", 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '',
"S_SMILIES_CHECKED" => ( !$smilies_on ) ? 'checked="checked"' : "", 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '',
"S_SIGNATURE_CHECKED" => ( $attach_sig ) ? 'checked="checked"' : "", 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
"S_NOTIFY_CHECKED" => ( $notify_user ) ? 'checked="checked"' : "", 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
"S_TYPE_TOGGLE" => $topic_type_toggle, 'S_TYPE_TOGGLE' => $topic_type_toggle,
"S_TOPIC_ID" => $topic_id, 'S_TOPIC_ID' => $topic_id,
"S_POST_ACTION" => append_sid("posting.$phpEx"), 'S_POST_ACTION' => append_sid("posting.$phpEx"),
"S_HIDDEN_FORM_FIELDS" => $hidden_form_fields) 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields)
); );
// //
// Poll entry switch/output // Poll entry switch/output
// //
if( ( $mode == "newtopic" || ( $mode == "editpost" && $post_data['first_post'] ) ) && $is_auth['auth_pollcreate'] ) if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $is_auth['auth_pollcreate'] )
{ {
$template->assign_vars(array( $template->assign_vars(array(
"L_ADD_A_POLL" => $lang['Add_poll'], 'L_ADD_A_POLL' => $lang['Add_poll'],
"L_ADD_POLL_EXPLAIN" => $lang['Add_poll_explain'], 'L_ADD_POLL_EXPLAIN' => $lang['Add_poll_explain'],
"L_POLL_QUESTION" => $lang['Poll_question'], 'L_POLL_QUESTION' => $lang['Poll_question'],
"L_POLL_OPTION" => $lang['Poll_option'], 'L_POLL_OPTION' => $lang['Poll_option'],
"L_ADD_OPTION" => $lang['Add_option'], 'L_ADD_OPTION' => $lang['Add_option'],
"L_UPDATE_OPTION" => $lang['Update'], 'L_UPDATE_OPTION' => $lang['Update'],
"L_DELETE_OPTION" => $lang['Delete'], 'L_DELETE_OPTION' => $lang['Delete'],
"L_POLL_LENGTH" => $lang['Poll_for'], 'L_POLL_LENGTH' => $lang['Poll_for'],
"L_DAYS" => $lang['Days'], 'L_DAYS' => $lang['Days'],
"L_POLL_LENGTH_EXPLAIN" => $lang['Poll_for_explain'], 'L_POLL_LENGTH_EXPLAIN' => $lang['Poll_for_explain'],
"L_POLL_DELETE" => $lang['Delete_poll'], 'L_POLL_DELETE' => $lang['Delete_poll'],
"POLL_TITLE" => $poll_title, 'POLL_TITLE' => $poll_title,
"POLL_LENGTH" => $poll_length) 'POLL_LENGTH' => $poll_length)
); );
if( $mode == 'editpost' && $post_data['edit_poll'] ) if( $mode == 'editpost' && $post_data['edit_poll'] )
{ {
$template->assign_block_vars("poll_delete_toggle", array()); $template->assign_block_vars('poll_delete_toggle', array());
} }
if( !empty($poll_options) ) if( !empty($poll_options) )
{ {
while( list($option_id, $option_text) = each($poll_options) ) while( list($option_id, $option_text) = each($poll_options) )
{ {
$template->assign_block_vars("poll_option_rows", array( $template->assign_block_vars('poll_option_rows', array(
"POLL_OPTION" => $option_text, 'POLL_OPTION' => $option_text,
"S_POLL_OPTION_NUM" => $option_id) 'S_POLL_OPTION_NUM' => $option_id)
); );
} }
} }
$template->assign_var_from_handle("POLLBOX", "pollbody"); $template->assign_var_from_handle('POLLBOX', 'pollbody');
} }
// //
@ -1075,14 +1078,14 @@ if( $mode == 'reply' )
require($phpbb_root_path . 'includes/topic_review.'.$phpEx); require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
topic_review($topic_id, true); topic_review($topic_id, true);
$template->assign_block_vars("switch_inline_mode", array()); $template->assign_block_vars('switch_inline_mode', array());
$template->assign_var_from_handle("TOPIC_REVIEW_BOX", "reviewbody"); $template->assign_var_from_handle('TOPIC_REVIEW_BOX', 'reviewbody');
} }
// //
// Parse and print the body // Parse and print the body
// //
$template->pparse("body"); $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

View file

@ -20,11 +20,12 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/post.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
// //
// Is PM disabled? // Is PM disabled?

File diff suppressed because it is too large Load diff

View file

@ -20,11 +20,12 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/search.'.$phpEx); include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
// //
// Start session management // Start session management

View file

@ -19,6 +19,8 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
if ( !defined('INSTALLING') ) if ( !defined('INSTALLING') )
{ {
error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
@ -47,7 +49,7 @@ $dbms = 'mysql';
include('includes/db.'.$phpEx); include('includes/db.'.$phpEx);
include('includes/bbcode.'.$phpEx); include('includes/bbcode.'.$phpEx);
include('includes/search.'.$phpEx); include('includes/functions_search.'.$phpEx);
set_time_limit(0); // Unlimited execution time set_time_limit(0); // Unlimited execution time

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);

View file

@ -20,6 +20,7 @@
* *
***************************************************************************/ ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./"; $phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);