diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 8575f339c1..7633c10be9 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -20,11 +20,11 @@ if (!defined('IN_PHPBB')) * * Jabber class from Flyspray project * -* @version class.jabber2.php 1306 2007-06-21 +* @version class.jabber2.php 1488 2007-11-25 * @copyright 2006 Flyspray.org * @author Florian Schmitz (floele) * -* Modified by Acyd Burn +* Only slightly modified by Acyd Burn * * @package phpBB3 */ @@ -286,7 +286,7 @@ class jabber $read = trim(fread($this->connection, 4096)); $data .= $read; } - while (time() <= $start + $timeout && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); + while (time() <= $start + $timeout && !feof($this->connection) && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); if ($data != '') { @@ -385,7 +385,6 @@ class jabber { case 'stream:stream': // Connection initialised (or after authentication). Not much to do here... - $this->session['id'] = $xml['stream:stream'][0]['@']['id']; if (isset($xml['stream:stream'][0]['#']['stream:features'])) { @@ -397,6 +396,16 @@ class jabber $this->features = $this->listen(); } + $second_time = isset($this->session['id']); + $this->session['id'] = $xml['stream:stream'][0]['@']['id']; + + if ($second_time) + { + // If we are here for the second time after TLS, we need to continue logging in + $this->login(); + return; + } + // go on with authentication? if (isset($this->features['stream:features'][0]['#']['bind']) || !empty($this->session['tls'])) { @@ -519,9 +528,10 @@ class jabber 'response' => $this->encrypt_password(array_merge($decoded, array('nc' => '00000001'))), 'charset' => 'utf-8', 'nc' => '00000001', + 'qop' => 'auth', // only auth being supported ); - foreach (array('nonce', 'qop', 'digest-uri', 'realm', 'cnonce') as $key) + foreach (array('nonce', 'digest-uri', 'realm', 'cnonce') as $key) { if (isset($decoded[$key])) { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c9921cc6f0..af9e69d00c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -137,6 +137,9 @@ function user_update_name($old_name, $new_name) { set_config('newest_username', $new_name, true); } + + // Because some tables/caches use username-specific data we need to purge this here. + $cache->destroy('sql', MODERATOR_CACHE_TABLE); } /** @@ -1472,20 +1475,6 @@ function validate_username($username, $allowed_username = false) } } - $sql = 'SELECT word - FROM ' . WORDS_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (preg_match('#(' . str_replace('\*', '.*?', preg_quote($row['word'], '#')) . ')#i', $username)) - { - $db->sql_freeresult($result); - return 'USERNAME_DISALLOWED'; - } - } - $db->sql_freeresult($result); - return false; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6e601e1499..eeaa6d9529 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -913,9 +913,14 @@ class bbcode_firstpass extends bbcode $url = ($var1) ? $var1 : $var2; - if (!$url || ($var1 && !$var2)) + if ($var1 && !$var2) { - return ''; + $var2 = $var1; + } + + if (!$url) + { + return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]'; } $valid = false; @@ -1088,7 +1093,7 @@ class parse_message extends bbcode_firstpass } // Check for "empty" message - if ($mode !== 'sig' && !utf8_clean_string($this->message)) + if ($mode !== 'sig' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return $this->warn_msg; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 6b56b52a5d..b2e91d8dde 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -494,12 +494,12 @@ function compose_pm($id, $mode, $action) } else { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; } - if (!$message) + if (utf8_clean_string($message) === '') { $error[] = $user->lang['TOO_FEW_CHARS']; } @@ -600,7 +600,7 @@ function compose_pm($id, $mode, $action) // Subject defined if ($submit) { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; } diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 15a5c6dca4..1481a88dc1 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -460,7 +460,7 @@ $lang = array_merge($lang, array( 'NO_VISIBLE_CHANGES' => 'No visible changes', 'NOTICE' => 'Notice', 'NUM_CONFLICTS' => 'Number of conflicts', - 'NUMBER_OF_FILES_COLLECTED' => 'Currently having differences about %1$d from %2$d files collected.
Please wait until file collection finished.', + 'NUMBER_OF_FILES_COLLECTED' => 'Currently differences of %1$d of %2$d files have been checked.
Please wait until all files are checked.', 'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index e41728a3d0..f7c9d101a8 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -141,10 +141,9 @@ switch ($mode) unset($admin_memberships); $sql = 'SELECT forum_id, forum_name - FROM ' . FORUMS_TABLE . ' - WHERE forum_type = ' . FORUM_POST; + FROM ' . FORUMS_TABLE; $result = $db->sql_query($sql); - + $forums = array(); while ($row = $db->sql_fetchrow($result)) { diff --git a/phpBB/posting.php b/phpBB/posting.php index 1236361e18..9ddaf52acd 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -520,12 +520,12 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( } else { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_SUBJECT']; } - if (!$message) + if (utf8_clean_string($message) === '') { $error[] = $user->lang['TOO_FEW_CHARS']; } @@ -769,7 +769,7 @@ if ($submit || $preview || $refresh) } // Parse subject - if (!$preview && !$refresh && !utf8_clean_string($post_data['post_subject']) && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + if (!$preview && !$refresh && utf8_clean_string($post_data['post_subject']) === '' && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) { $error[] = $user->lang['EMPTY_SUBJECT']; }