aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_attachments.php6
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php6
-rw-r--r--phpBB/includes/acp/acp_reasons.php8
-rw-r--r--phpBB/includes/acp/acp_styles.php10
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/acp/auth.php4
-rw-r--r--phpBB/includes/extension/controller.php6
-rw-r--r--phpBB/includes/extension/finder.php14
-rw-r--r--phpBB/includes/extension/manager.php14
-rw-r--r--phpBB/includes/functions_display.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php207
-rw-r--r--phpBB/includes/functions_profile_fields.php42
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/search/fulltext_native.php2
-rw-r--r--phpBB/includes/style/style.php6
-rw-r--r--phpBB/includes/template/template.php8
-rw-r--r--phpBB/includes/ucp/ucp_groups.php5
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php8
-rw-r--r--phpBB/includes/update_helpers.php80
21 files changed, 250 insertions, 188 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 3433d7e2cd..eccc935a6e 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -98,7 +98,7 @@ class acp_attachments
}
$db->sql_freeresult($result);
- $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
+ $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
$display_vars = array(
'title' => 'ACP_ATTACHMENT_SETTINGS',
@@ -917,7 +917,7 @@ class acp_attachments
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
- $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files));
+ $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files));
}
$upload_list = array();
@@ -1074,7 +1074,7 @@ class acp_attachments
$error[] = $user->lang['FILES_GONE'];
}
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames));
- $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode(', ', $deleted_filenames));
+ $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames));
}
else
{
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index d728744c04..dd071074de 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -497,7 +497,7 @@ class acp_permissions
$template->assign_vars(array(
'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false,
- 'FORUM_NAMES' => implode(', ', $forum_names))
+ 'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names))
);
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 3ffffd3047..849160f1fa 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -383,6 +383,7 @@ class acp_profile
$field_row = array_merge($default_values[$field_type], array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,
+ 'field_show_novalue'=> 0,
'field_hide' => 0,
'field_show_profile'=> 0,
'field_no_view' => 0,
@@ -399,7 +400,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@@ -424,6 +425,7 @@ class acp_profile
// Visibility Options...
$visibility_ary = array(
'field_required',
+ 'field_show_novalue',
'field_show_on_reg',
'field_show_on_pm',
'field_show_on_vt',
@@ -779,6 +781,7 @@ class acp_profile
$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
+ 'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
@@ -1096,6 +1099,7 @@ class acp_profile
'field_default_value' => $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],
+ 'field_show_novalue' => $cp->vars['field_show_novalue'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
'field_show_on_pm' => $cp->vars['field_show_on_pm'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 479fcfba81..71e9108c2c 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -113,7 +113,7 @@ class acp_reasons
$result = $db->sql_query($sql);
$max_order = (int) $db->sql_fetchfield('max_reason_order');
$db->sql_freeresult($result);
-
+
$sql_ary = array(
'reason_title' => (string) $reason_row['reason_title'],
'reason_description' => (string) $reason_row['reason_description'],
@@ -171,14 +171,14 @@ class acp_reasons
'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
-
+
'REASON_TITLE' => $reason_row['reason_title'],
'REASON_DESCRIPTION' => $reason_row['reason_description'],
'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '',
'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '',
- 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
+ 'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
@@ -303,7 +303,7 @@ class acp_reasons
do
{
++$order;
-
+
if ($row['reason_order'] != $order)
{
$sql = 'UPDATE ' . REPORTS_REASONS_TABLE . "
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 943bfe6a6f..d41ef571dd 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -36,11 +36,11 @@ class acp_styles
protected $cache;
protected $auth;
protected $phpbb_root_path;
- protected $phpEx;
+ protected $php_ext;
public function main($id, $mode)
{
- global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
+ global $db, $user, $phpbb_admin_path, $phpbb_root_path, $php_ext, $template, $request, $cache, $auth, $config;
$this->db = $db;
$this->user = $user;
@@ -50,12 +50,12 @@ class acp_styles
$this->auth = $auth;
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->default_style = $config['default_style'];
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
- $this->u_base_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$id}");
+ $this->u_base_action = append_sid("{$phpbb_admin_path}index.$php_ext", "i={$id}");
$this->s_hidden_fields = array(
'mode' => $mode,
);
@@ -939,7 +939,7 @@ class acp_styles
// Preview
$actions[] = array(
- 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->phpEx, 'style=' . $style['style_id']),
+ 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']),
'L_ACTION' => $this->user->lang['PREVIEW']
);
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 79c91dd7ee..62968a17b7 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1943,7 +1943,7 @@ class acp_users
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
- add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments));
+ add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments));
trigger_error($message . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 7d9fd267ff..6b1da46a12 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -529,8 +529,8 @@ class auth_admin extends phpbb_auth
'NAME' => $ug_name,
'CATEGORIES' => implode('</th><th>', $categories),
- 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
- 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
+ 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '',
+ 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '',
'L_ACL_TYPE' => $l_acl_type,
'S_LOCAL' => ($local) ? true : false,
diff --git a/phpBB/includes/extension/controller.php b/phpBB/includes/extension/controller.php
index c7fd439a19..ec051c756f 100644
--- a/phpBB/includes/extension/controller.php
+++ b/phpBB/includes/extension/controller.php
@@ -50,7 +50,7 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_
/**
* @var string PHP Extension
*/
- protected $phpEx;
+ protected $php_ext;
/**
* @var string Relative path to board root
@@ -64,14 +64,14 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_
public function __construct()
{
global $request, $db, $user, $template, $config;
- global $phpEx, $phpbb_root_path;
+ global $php_ext, $phpbb_root_path;
$this->request = $request;
$this->db = $db;
$this->user = $user;
$this->template = $template;
$this->config = $config;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->phpbb_root_path = $phpbb_root_path;
}
}
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php
index 87ca40917d..fb19b98429 100644
--- a/phpBB/includes/extension/finder.php
+++ b/phpBB/includes/extension/finder.php
@@ -25,7 +25,7 @@ class phpbb_extension_finder
protected $extension_manager;
protected $phpbb_root_path;
protected $cache;
- protected $phpEx;
+ protected $php_ext;
/**
* The cache variable name used to store $this->cached_queries in $this->cache.
@@ -56,16 +56,16 @@ class phpbb_extension_finder
* extensions and their locations
* @param string $phpbb_root_path Path to the phpbb root directory
* @param phpbb_cache_driver_interface $cache A cache instance or null
- * @param string $phpEx php file extension
+ * @param string $php_ext php file extension
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
*/
- public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php', $cache_name = '_ext_finder')
+ public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder')
{
$this->extension_manager = $extension_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->cache = $cache;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->cache_name = $cache_name;
$this->query = array(
@@ -251,8 +251,8 @@ class phpbb_extension_finder
*/
public function get_classes($cache = true)
{
- $this->query['extension_suffix'] .= $this->phpEx;
- $this->query['core_suffix'] .= $this->phpEx;
+ $this->query['extension_suffix'] .= $this->php_ext;
+ $this->query['core_suffix'] .= $this->php_ext;
$files = $this->find($cache, false);
@@ -261,7 +261,7 @@ class phpbb_extension_finder
{
$file = preg_replace('#^includes/#', '', $file);
- $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->phpEx)));
+ $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->php_ext)));
}
return $classes;
}
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index 537c19aff8..86d8fab64b 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -23,7 +23,7 @@ if (!defined('IN_PHPBB'))
class phpbb_extension_manager
{
protected $cache;
- protected $phpEx;
+ protected $php_ext;
protected $extensions;
protected $extension_table;
protected $phpbb_root_path;
@@ -35,16 +35,16 @@ class phpbb_extension_manager
* @param dbal $db A database connection
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
- * @param string $phpEx php file extension
+ * @param string $php_ext php file extension
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
- public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
+ public function __construct(dbal $db, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
$this->cache = $cache;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->extension_table = $extension_table;
$this->cache_name = $cache_name;
@@ -362,7 +362,7 @@ class phpbb_extension_manager
RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
- if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx)
+ if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->php_ext)
{
$ext_name = $iterator->getInnerIterator()->getSubPath();
@@ -432,7 +432,7 @@ class phpbb_extension_manager
}
return $disabled;
}
-
+
/**
* Check to see if a given extension is available on the filesystem
*
@@ -462,6 +462,6 @@ class phpbb_extension_manager
*/
public function get_finder()
{
- return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx, $this->cache_name . '_finder');
+ return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
}
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 00efd281c0..a1ff7a1f99 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -411,7 +411,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{
$l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
- $moderators_list = implode(', ', $forum_moderators[$forum_id]);
+ $moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]);
}
$l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS';
@@ -422,7 +422,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>';
}
- $s_subforums_list = (string) implode(', ', $s_subforums_list);
+ $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
if ($row['forum_type'] != FORUM_LINK)
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 8542e3ab0a..9e055a319f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1147,127 +1147,166 @@ function phpbb_delete_user_pms($user_id)
// Get PM Information for later deleting
// The two queries where split, so we can use our indexes
+ $undelivered_msg = $delete_ids = array();
+
// Part 1: get PMs the user received
- $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ $sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);
- $undelivered_msg = $undelivered_user = $delete_ids = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
- {
- // Undelivered messages
- $undelivered_msg[] = $row['msg_id'];
-
- if (isset($undelivered_user[$row['user_id']]))
- {
- ++$undelivered_user[$row['user_id']];
- }
- else
- {
- $undelivered_user[$row['user_id']] = 1;
- }
- }
-
- $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ $msg_id = (int) $row['msg_id'];
+ $delete_ids[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
- // Part 2: get PMs the user sent
- $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ // Part 2: get PMs the user sent, but have yet to be received
+ // We cannot simply delete them. First we have to check,
+ // whether another user already received and read the message.
+ $sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE author_id = ' . $user_id . '
- AND folder_id = ' . PRIVMSGS_NO_BOX;
+ AND folder_id = ' . PRIVMSGS_NO_BOX;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
- {
- // Undelivered messages
- $undelivered_msg[] = $row['msg_id'];
-
- if (isset($undelivered_user[$row['user_id']]))
- {
- ++$undelivered_user[$row['user_id']];
- }
- else
- {
- $undelivered_user[$row['user_id']] = 1;
- }
- }
-
- $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ $msg_id = (int) $row['msg_id'];
+ $undelivered_msg[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
- if (empty($delete_ids))
+ if (empty($delete_ids) && empty($undelivered_msg))
{
return false;
}
$db->sql_transaction('begin');
- if (sizeof($undelivered_msg))
- {
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
- $db->sql_query($sql);
- }
+ if (!empty($undelivered_msg))
+ {
+ // A pm is delivered, if for any recipient the message was moved
+ // from their NO_BOX to another folder. We do not delete such
+ // messages, but only delete them for users, who have not yet
+ // received them.
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE author_id = ' . $user_id . '
+ AND folder_id <> ' . PRIVMSGS_NO_BOX . '
+ AND folder_id <> ' . PRIVMSGS_OUTBOX . '
+ AND folder_id <> ' . PRIVMSGS_SENTBOX;
+ $result = $db->sql_query($sql);
- // Reset the userīs pm count to 0
- if (isset($undelivered_user[$user_id]))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_new_privmsg = 0,
- user_unread_privmsg = 0
- WHERE user_id = ' . $user_id;
- $db->sql_query($sql);
- unset($undelivered_user[$user_id]);
- }
+ $delivered_msg = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $msg_id = (int) $row['msg_id'];
+ $delivered_msg[$msg_id] = $msg_id;
+ unset($undelivered_msg[$msg_id]);
+ }
+ $db->sql_freeresult($result);
- foreach ($undelivered_user as $_user_id => $count)
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_new_privmsg = user_new_privmsg - ' . $count . ',
- user_unread_privmsg = user_unread_privmsg - ' . $count . '
- WHERE user_id = ' . $_user_id;
- $db->sql_query($sql);
- }
+ $undelivered_user = array();
- // Delete private message data
- $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
- WHERE user_id = $user_id
- AND " . $db->sql_in_set('msg_id', $delete_ids);
- $db->sql_query($sql);
+ // Count the messages we delete, so we can correct the user pm data
+ $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE author_id = ' . $user_id . '
+ AND folder_id = ' . PRIVMSGS_NO_BOX . '
+ AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . '
+ GROUP BY user_id';
+ $result = $db->sql_query($sql);
- // Now we have to check which messages we can delete completely
- $sql = 'SELECT msg_id
- FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
- $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $num_pms = (int) $row['num_undelivered_privmsgs'];
+ $undelivered_user[$num_pms][] = (int) $row['user_id'];
- while ($row = $db->sql_fetchrow($result))
- {
- unset($delete_ids[$row['msg_id']]);
+ if (sizeof($undelivered_user[$num_pms]) > 50)
+ {
+ // If there are too many users affected the query might get
+ // too long, so we update the value for the first bunch here.
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
+ user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
+ WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]);
+ $db->sql_query($sql);
+ unset($undelivered_user[$num_pms]);
+ }
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($undelivered_user as $num_pms => $undelivered_user_set)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
+ user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
+ WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set);
+ $db->sql_query($sql);
+ }
+
+ if (!empty($delivered_msg))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE folder_id = ' . PRIVMSGS_NO_BOX . '
+ AND ' . $db->sql_in_set('msg_id', $delivered_msg);
+ $db->sql_query($sql);
+ }
+
+ if (!empty($undelivered_msg))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
+ $db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
+ $db->sql_query($sql);
+ }
}
- $db->sql_freeresult($result);
+
+ // Reset the user's pm count to 0
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = 0,
+ user_unread_privmsg = 0
+ WHERE user_id = ' . $user_id;
+ $db->sql_query($sql);
+
+ // Delete private message data of the user
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE user_id = ' . (int) $user_id;
+ $db->sql_query($sql);
if (!empty($delete_ids))
{
- // Check if there are any attachments we need to remove
- if (!function_exists('delete_attachments'))
+ // Now we have to check which messages we can delete completely
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ unset($delete_ids[$row['msg_id']]);
}
+ $db->sql_freeresult($result);
- delete_attachments('message', $delete_ids, false);
+ if (!empty($delete_ids))
+ {
+ // Check if there are any attachments we need to remove
+ if (!function_exists('delete_attachments'))
+ {
+ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
- $db->sql_query($sql);
+ delete_attachments('message', $delete_ids, false);
+
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $db->sql_query($sql);
+ }
}
// Set the remaining author id to anonymous
@@ -2045,7 +2084,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
'SUBJECT' => $subject,
'SENT_DATE' => $user->format_date($row['message_time']),
'MESSAGE' => $message,
- 'FOLDER' => implode(', ', $row['folder']),
+ 'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']),
'DECODED_MESSAGE' => $decoded_message,
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 1c15ef897f..10af997bff 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -121,7 +121,7 @@ class custom_profile
case FIELD_BOOL:
$field_value = (bool) $field_value;
-
+
if (!$field_value && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
@@ -133,7 +133,7 @@ class custom_profile
{
return false;
}
-
+
$field_value = (int) $field_value;
if ($field_value < $field_data['field_minlen'])
@@ -455,6 +455,8 @@ class custom_profile
$user_fields = array();
+ $user_ids = $user_id;
+
// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)
{
@@ -463,6 +465,15 @@ class custom_profile
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
+
+ foreach ($user_ids as $user_id)
+ {
+ if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
+ {
+ $user_fields[$user_id][$used_ident]['value'] = '';
+ $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
+ }
+ }
}
return $user_fields;
@@ -520,7 +531,7 @@ class custom_profile
switch ($this->profile_types[$field_type])
{
case 'int':
- if ($value === '')
+ if ($value === '' && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -529,7 +540,7 @@ class custom_profile
case 'string':
case 'text':
- if (!$value)
+ if (!$value && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -547,7 +558,7 @@ class custom_profile
$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;
- if (!$day && !$month && !$year)
+ if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -573,12 +584,7 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}
- // If a dropdown field is required, users
- // cannot choose the "no value" option.
- // They must choose one of the other options.
- // Therefore, here we treat a value equal to
- // the "no value" as a lack of value, i.e. NULL.
- if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
+ if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -588,7 +594,14 @@ class custom_profile
// User not having a value assigned
if (!isset($this->options_lang[$field_id][$lang_id][$value]))
{
- return NULL;
+ if ($ident_ary['data']['field_show_novalue'])
+ {
+ $value = $ident_ary['data']['field_novalue'];
+ }
+ else
+ {
+ return NULL;
+ }
}
return $this->options_lang[$field_id][$lang_id][$value];
@@ -602,6 +615,11 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
}
+ if (!$value && $ident_ary['data']['field_show_novalue'])
+ {
+ $value = $ident_ary['data']['field_default_value'];
+ }
+
if ($ident_ary['data']['field_length'] == 1)
{
return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL;
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 41e912fff9..24e531517c 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -291,7 +291,7 @@ class mcp_pm_reports
'REPORT_ID' => $row['report_id'],
'REPORT_TIME' => $user->format_date($row['report_time']),
- 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]),
+ 'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]),
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 3e029c86d0..1e2074b1b1 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -334,7 +334,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
// throw an error if we shall not ignore unexistant words
else if (!$ignore_no_id && sizeof($non_common_words))
{
- trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words)));
+ trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode($user->lang['COMMA_SEPARATOR'], $non_common_words)));
}
unset($non_common_words);
}
diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php
index 22e0f1d67a..6b7cd31cb3 100644
--- a/phpBB/includes/style/style.php
+++ b/phpBB/includes/style/style.php
@@ -38,7 +38,7 @@ class phpbb_style
* PHP file extension
* @var string
*/
- private $phpEx;
+ private $php_ext;
/**
* phpBB config instance
@@ -73,10 +73,10 @@ class phpbb_style
* @param phpbb_style_path_provider $provider style path provider
* @param phpbb_template $template template
*/
- public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
+ public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
{
$this->phpbb_root_path = $phpbb_root_path;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
$this->locator = $locator;
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index 8ab3c44be3..13fa845659 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -54,7 +54,7 @@ class phpbb_template
* PHP file extension
* @var string
*/
- private $phpEx;
+ private $php_ext;
/**
* phpBB config instance
@@ -87,10 +87,10 @@ class phpbb_template
* @param user $user current user
* @param phpbb_template_locator $locator template locator
*/
- public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator)
+ public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_locator $locator)
{
$this->phpbb_root_path = $phpbb_root_path;
- $this->phpEx = $phpEx;
+ $this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
$this->locator = $locator;
@@ -313,7 +313,7 @@ class phpbb_template
private function _compiled_file_for_handle($handle)
{
$source_file = $this->locator->get_filename_for_handle($handle);
- $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->phpEx;
+ $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->php_ext;
return $compiled_file;
}
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index aa9510b63b..65ab92e78e 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -846,7 +846,7 @@ class ucp_groups
$base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
-
+
$template->assign_vars(array(
'S_LIST' => true,
'S_ACTION_OPTIONS' => $s_action_options,
@@ -1069,7 +1069,8 @@ class ucp_groups
'mode' => $mode,
'action' => $action
);
- confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields));
+
+ confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields));
}
trigger_error($user->lang['NO_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 1b474457b3..d8bcd374fe 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -874,7 +874,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
$forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
- $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
+ $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
$message_parser->message = implode("\n", $forward_text) . "\n\n[quote=&quot;{$quote_username}&quot;]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index dc77587452..1026f24699 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -176,7 +176,7 @@ function view_folder($id, $mode, $folder_id, $folder)
'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url,
'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '',
'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $row['report_id']) : '',
- 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '')
+ 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '')
);
}
unset($folder_info['rowset']);
@@ -266,9 +266,9 @@ function view_folder($id, $mode, $folder_id, $folder)
}
}
- // There is the chance that all recipients of the message got deleted. To avoid creating
+ // There is the chance that all recipients of the message got deleted. To avoid creating
// exports without recipients, we add a bogus "undisclosed recipient".
- if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
+ if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
!(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
{
$address[$message_id]['u'] = array();
@@ -277,7 +277,7 @@ function view_folder($id, $mode, $folder_id, $folder)
}
decode_message($message_row['message_text'], $message_row['bbcode_uid']);
-
+
$data[] = array(
'subject' => censor_text($row['message_subject']),
'sender' => $row['username'],
diff --git a/phpBB/includes/update_helpers.php b/phpBB/includes/update_helpers.php
index 8e8e9670b0..69d678b2f8 100644
--- a/phpBB/includes/update_helpers.php
+++ b/phpBB/includes/update_helpers.php
@@ -26,85 +26,85 @@ class phpbb_update_helpers
switch ($timezone)
{
case '-12':
- return 'Etc/GMT' . $offset; //'[UTC - 12] Baker Island Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time'
case '-11':
- return 'Etc/GMT' . $offset; //'[UTC - 11] Niue Time, Samoa Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time'
case '-10':
- return 'Etc/GMT' . $offset; //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time'
case '-9.5':
- return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time'
+ return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time'
case '-9':
- return 'Etc/GMT' . $offset; //'[UTC - 9] Alaska Standard Time, Gambier Island Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time'
case '-8':
- return 'Etc/GMT' . $offset; //'[UTC - 8] Pacific Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time'
case '-7':
- return 'Etc/GMT' . $offset; //'[UTC - 7] Mountain Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time'
case '-6':
- return 'Etc/GMT' . $offset; //'[UTC - 6] Central Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time'
case '-5':
- return 'Etc/GMT' . $offset; //'[UTC - 5] Eastern Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time'
case '-4.5':
- return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time'
+ return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time'
case '-4':
- return 'Etc/GMT' . $offset; //'[UTC - 4] Atlantic Standard Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time'
case '-3.5':
- return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time'
+ return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time'
case '-3':
- return 'Etc/GMT' . $offset; //'[UTC - 3] Amazon Standard Time, Central Greenland Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time'
case '-2':
- return 'Etc/GMT' . $offset; //'[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time'
case '-1':
- return 'Etc/GMT' . $offset; //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time'
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time'
case '0':
- return (!$dst) ? 'UTC' : 'Etc/GMT+1'; //'[UTC] Western European Time, Greenwich Mean Time'
+ return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time'
case '1':
- return 'Etc/GMT+' . $offset; //'[UTC + 1] Central European Time, West African Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time'
case '2':
- return 'Etc/GMT+' . $offset; //'[UTC + 2] Eastern European Time, Central African Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time'
case '3':
- return 'Etc/GMT+' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time'
case '3.5':
- return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time'
+ return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time'
case '4':
- return 'Etc/GMT+' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time'
case '4.5':
- return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time'
+ return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time'
case '5':
- return 'Etc/GMT+' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time'
case '5.5':
- return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time'
+ return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time'
case '5.75':
- return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time'
+ return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time'
case '6':
- return 'Etc/GMT+' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time'
case '6.5':
- return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time'
+ return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time'
case '7':
- return 'Etc/GMT+' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time'
case '8':
- return 'Etc/GMT+' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time'
case '8.75':
- return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time'
+ return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time'
case '9':
- return 'Etc/GMT+' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time'
case '9.5':
- return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time'
+ return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time'
case '10':
- return 'Etc/GMT+' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time'
case '10.5':
- return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time'
+ return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time'
case '11':
- return 'Etc/GMT+' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time'
+ return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time'
case '11.5':
- return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time'
+ return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time'
case '12':
- return 'Etc/GMT+12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time'
+ return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time'
case '12.75':
- return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time'
+ return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time'
case '13':
- return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time'
+ return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time'
case '14':
- return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time'
+ return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time'
default:
return 'UTC';
}