From 19aed179e53f9660a7202e2e50816e1cef0f7be9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 28 Dec 2008 23:30:09 +0000 Subject: $config to phpbb::$config git-svn-id: file:///svn/phpbb/trunk@9242 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 80 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'phpBB/includes/message_parser.php') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 5bbadd4d4c..14b87c05b2 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -194,16 +194,16 @@ class bbcode_firstpass extends bbcode */ function bbcode_size($stx, $in) { - global $user, $config; + global $user; if (!$this->check_bbcode('size', $in)) { return $in; } - if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx) + if (phpbb::$config['max_' . $this->mode . '_font_size'] && phpbb::$config['max_' . $this->mode . '_font_size'] < $stx) { - $this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], $config['max_' . $this->mode . '_font_size']); + $this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], phpbb::$config['max_' . $this->mode . '_font_size']); return '[size=' . $stx . ']' . $in . '[/size]'; } @@ -274,7 +274,7 @@ class bbcode_firstpass extends bbcode */ function bbcode_img($in) { - global $user, $config; + global $user; if (!$this->check_bbcode('img', $in)) { @@ -298,7 +298,7 @@ class bbcode_firstpass extends bbcode $in = 'http://' . $in; } - if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + if (phpbb::$config['max_' . $this->mode . '_img_height'] || phpbb::$config['max_' . $this->mode . '_img_width']) { $stats = @getimagesize($in); @@ -309,16 +309,16 @@ class bbcode_firstpass extends bbcode } else { - if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1]) + if (phpbb::$config['max_' . $this->mode . '_img_height'] && phpbb::$config['max_' . $this->mode . '_img_height'] < $stats[1]) { $error = true; - $this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']); + $this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], phpbb::$config['max_' . $this->mode . '_img_height']); } - if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0]) + if (phpbb::$config['max_' . $this->mode . '_img_width'] && phpbb::$config['max_' . $this->mode . '_img_width'] < $stats[0]) { $error = true; - $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); + $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], phpbb::$config['max_' . $this->mode . '_img_width']); } } } @@ -336,7 +336,7 @@ class bbcode_firstpass extends bbcode */ function bbcode_flash($width, $height, $in) { - global $user, $config; + global $user; if (!$this->check_bbcode('flash', $in)) { @@ -353,18 +353,18 @@ class bbcode_firstpass extends bbcode } // Apply the same size checks on flash files as on images - if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + if (phpbb::$config['max_' . $this->mode . '_img_height'] || phpbb::$config['max_' . $this->mode . '_img_width']) { - if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $height) + if (phpbb::$config['max_' . $this->mode . '_img_height'] && phpbb::$config['max_' . $this->mode . '_img_height'] < $height) { $error = true; - $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']); + $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], phpbb::$config['max_' . $this->mode . '_img_height']); } - if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $width) + if (phpbb::$config['max_' . $this->mode . '_img_width'] && phpbb::$config['max_' . $this->mode . '_img_width'] < $width) { $error = true; - $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); + $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], phpbb::$config['max_' . $this->mode . '_img_width']); } } @@ -685,7 +685,7 @@ class bbcode_firstpass extends bbcode */ function bbcode_quote($in) { - global $config, $user; + global $user; /** * If you change this code, make sure the cases described within the following reports are still working: @@ -752,10 +752,10 @@ class bbcode_firstpass extends bbcode $this->parsed_items['quote']++; // the buffer holds a valid opening tag - if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth']) + if (phpbb::$config['max_quote_depth'] && sizeof($close_tags) >= phpbb::$config['max_quote_depth']) { // there are too many nested quotes - $error_ary['quote_depth'] = sprintf($user->lang['QUOTE_DEPTH_EXCEEDED'], $config['max_quote_depth']); + $error_ary['quote_depth'] = sprintf($user->lang['QUOTE_DEPTH_EXCEEDED'], phpbb::$config['max_quote_depth']); $out .= $buffer . $tok; $tok = '[]'; @@ -916,8 +916,6 @@ class bbcode_firstpass extends bbcode */ function validate_url($var1, $var2) { - global $config; - $var1 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var1))); $var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2))); @@ -979,11 +977,11 @@ class bbcode_firstpass extends bbcode */ function path_in_domain($url) { - global $config, $user; + global $user; - if ($config['force_server_vars']) + if (phpbb::$config['force_server_vars']) { - $check_path = $config['script_path']; + $check_path = phpbb::$config['script_path']; } else { @@ -996,9 +994,9 @@ class bbcode_firstpass extends bbcode $server_name = $user->host; // Forcing server vars is the only way to specify/override the protocol - if ($config['force_server_vars'] || !$server_name) + if (phpbb::$config['force_server_vars'] || !$server_name) { - $server_name = $config['server_name']; + $server_name = phpbb::$config['server_name']; } // Check again in correct order... @@ -1061,7 +1059,7 @@ class parse_message extends bbcode_firstpass */ function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { - global $config, $db, $user; + global $db, $user; $mode = ($mode != 'post') ? 'sig' : 'post'; @@ -1091,13 +1089,13 @@ class parse_message extends bbcode_firstpass $this->message = preg_replace($match, $replace, trim($this->message)); // Message length check. 0 disables this check completely. - if ($config['max_' . $mode . '_chars'] > 0) + if (phpbb::$config['max_' . $mode . '_chars'] > 0) { $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)); - if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) + if ((!$msg_len && $mode !== 'sig') || phpbb::$config['max_' . $mode . '_chars'] && $msg_len > phpbb::$config['max_' . $mode . '_chars']) { - $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']); + $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, phpbb::$config['max_' . $mode . '_chars']); return (!$update_this_message) ? $return_message : $this->warn_msg; } } @@ -1128,7 +1126,7 @@ class parse_message extends bbcode_firstpass // Parse smilies if ($allow_smilies) { - $this->smilies($config['max_' . $mode . '_smilies']); + $this->smilies(phpbb::$config['max_' . $mode . '_smilies']); } $num_urls = 0; @@ -1145,16 +1143,16 @@ class parse_message extends bbcode_firstpass { $this->magic_url(generate_board_url()); - if ($config['max_' . $mode . '_urls']) + if (phpbb::$config['max_' . $mode . '_urls']) { $num_urls += preg_match_all('#\