aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_modules.php2
-rw-r--r--phpBB/includes/functions_module.php31
-rw-r--r--phpBB/includes/functions_user.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php4
4 files changed, 32 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 6792886d2a..100e33044b 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -565,7 +565,7 @@ class acp_modules
{
// Skip entries we do not need if we know the module we are
// looking for
- if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false)
+ if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false && $module !== $cur_module)
{
continue;
}
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index b33f3d6866..dca720c36e 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -519,7 +519,7 @@ class p_master
}
// Not being able to overwrite ;)
- $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
+ $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=' . $this->get_module_identifier($this->p_name, $this->p_id)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
}
else
{
@@ -551,7 +551,7 @@ class p_master
$this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
}
- $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
+ $this->module->u_action = append_sid($this->module->u_action, 'i=' . $this->get_module_identifier($this->p_name, $this->p_id)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
}
// Add url_extra parameter to u_action url
@@ -799,12 +799,12 @@ class p_master
// if the item has a name use it, else use its id
if (empty($item_ary['name']))
{
- $u_title .= $item_ary['id'];
+ $u_title .= $item_ary['id'];
}
else
{
// if the category has a name, then use it.
- $u_title .= $item_ary['name'];
+ $u_title .= $this->get_module_identifier($item_ary['name'], $item_ary['id']);
}
// If the item is not a category append the mode
if (!$item_ary['cat'])
@@ -983,6 +983,29 @@ class p_master
}
/**
+ * If the basename contains a \ we dont use that for the URL.
+ *
+ * Firefox is currently unable to correctly copy a urlencoded \
+ * so users will be unable to post links to modules.
+ * However we can still fallback to the id instead of the name,
+ * so we do that in this case.
+ *
+ * @param string $basename Basename of the module
+ * @param int $id Id of the module
+ * @return mixed Identifier that should be used for
+ * module link creation
+ */
+ protected function get_module_identifier($basename, $id)
+ {
+ if (strpos($basename, '\\') === false)
+ {
+ return $basename;
+ }
+
+ return $id;
+ }
+
+ /**
* Checks whether the given module basename is a correct class name
*
* @param string $basename A module basename
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 0a0656377c..30891c3fb5 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2754,8 +2754,8 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
* Event before users are removed from a group
*
* @event core.group_delete_user_before
- * @var int group_id ID of the group from which users are deleted
- * @var string group_name Name of the group
+ * @var int group_id ID of the group from which users are deleted
+ * @var string group_name Name of the group
* @var array user_id_ary IDs of the users which are removed
* @var array username_ary names of the users which are removed
* @since 3.1-A1
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index c7b4489daf..cebbadc7c7 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -254,8 +254,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
* @var string mode Active module
* @var int folder_id ID of the folder the message is in
* @var int msg_id ID of the private message
- * var array folder Array with data of user's message folders
- * @var array message_row Array with message data
+ * @var array folder Array with data of user's message folders
+ * @var array message_row Array with message data
* @var array cp_row Array with senders custom profile field data
* @var array msg_data Template array with message data
* @since 3.1-A1