From 8822747b91883b0b9ddf322ce052ccb11f4429d5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 5 Jun 2008 14:11:42 +0000 Subject: [PATCH] merge... git-svn-id: file:///svn/phpbb/trunk@8610 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/coding-guidelines.html | 2 +- phpBB/includes/acp/acp_ban.php | 2 +- phpBB/includes/functions.php | 8 ++++---- phpBB/includes/mcp/mcp_ban.php | 2 +- phpBB/includes/mcp/mcp_queue.php | 2 +- phpBB/viewtopic.php | 9 ++++++++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 38410fd0cc..961088a381 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1456,7 +1456,7 @@ div

What are Unicode, UCS and UTF-8?

-

The Universal Character Set (UCS) described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. Unicode - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the Unicode Consortium's website. One of the Unicode encodings is the 8-bit Unicode Transformation Format (UTF-8). It encodes characters with up to four bytes aiming for maximum compatability with the American Standard Code for Information Interchange which is a 7-bit encoding of a relatively small subset of the UCS.

+

The Universal Character Set (UCS) described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. Unicode - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the Unicode Consortium's website. One of the Unicode encodings is the 8-bit Unicode Transformation Format (UTF-8). It encodes characters with up to four bytes aiming for maximum compatibility with the American Standard Code for Information Interchange which is a 7-bit encoding of a relatively small subset of the UCS.

phpBB's use of Unicode

Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in /includes/utf/utf_tools.php. They are also covered in the phpBB3 Sourcecode Documentation. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example explode still works as long as the first and the last character of the delimiter string are ASCII characters.

diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 3d60ffbe09..82c4d6e8c5 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -97,7 +97,7 @@ class acp_ban break; } - $this->display_ban_options($mode); + self::display_ban_options($mode); $template->assign_vars(array( 'L_TITLE' => $this->page_title, diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ed784405ac..6b5efd3559 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2915,15 +2915,15 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { // flush the content, else we get a white page if output buffering is on - if (strtolower(@ini_get('output_buffering')) !== 'off') + if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on') { - @ob_end_flush(); + @ob_flush(); } - // Another quick fix for those having gzip compression enabled + // Another quick fix for those having gzip compression enabled, but do not flush if the coder wants to catch "something". ;) if ($config['gzip_compress']) { - if (@extension_loaded('zlib') && !headers_sent()) + if (@extension_loaded('zlib') && !headers_sent() && !ob_get_level()) { @ob_flush(); } diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index f63b1a4237..30d015fa0a 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -158,7 +158,7 @@ class mcp_ban // As a "service" we will check if any post id is specified and populate the username of the poster id if given $post_id = request_var('p', 0); $user_id = request_var('u', 0); - $username = false; + $username = $pre_fill = false; if ($user_id && $user_id <> ANONYMOUS) { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index eea00e5660..d1537df0e0 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -74,7 +74,7 @@ class mcp_queue $this->tpl_name = 'mcp_post'; - $user->add_lang('posting'); + $user->add_lang(array('posting', 'viewtopic')); $post_id = request_var('p', 0); $topic_id = request_var('t', 0); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7577afc0ff..8c4ddb1505 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -451,9 +451,16 @@ $s_watching_topic = array( 'is_watching' => false, ); -if ($config['email_enable'] && $config['allow_topic_notify'] && $user->data['is_registered']) +if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered']) { watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start); + + // Reset forum notification if forum notify is set + if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id)) + { + $s_watching_forum = $s_watching_topic; + watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0); + } } // Bookmarks