aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions_module.php24
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php21
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html2
4 files changed, 16 insertions, 33 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 397e6401ff..fe9bcdb9d1 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -489,6 +489,12 @@ class p_master
$id = request_var('icat', '');
}
+ // Restore the backslashes in class names
+ if (strpos($id, '-') !== false)
+ {
+ $id = str_replace('-', '\\', $id);
+ }
+
if ($id && !is_numeric($id) && !$this->is_full_class($id))
{
$id = $this->p_class . '_' . $id;
@@ -616,7 +622,7 @@ class p_master
}
// Not being able to overwrite ;)
- $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}";
+ $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=' . $this->get_module_identifier($this->p_name)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
}
else
{
@@ -648,7 +654,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->get_module_identifier($this->p_name, $this->p_id)) . (($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)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
}
// Add url_extra parameter to u_action url
@@ -901,7 +907,7 @@ class p_master
else
{
// if the category has a name, then use it.
- $u_title .= $this->get_module_identifier($item_ary['name'], $item_ary['id']);
+ $u_title .= $this->get_module_identifier($item_ary['name']);
}
// If the item is not a category append the mode
if (!$item_ary['cat'])
@@ -1106,26 +1112,24 @@ class p_master
}
/**
- * If the basename contains a \ we dont use that for the URL.
+ * If the basename contains a \ we don't 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.
+ * However we can replace them with dashes and re-replace them later
*
* @param string $basename Basename of the module
- * @param int $id Id of the module
- * @return mixed Identifier that should be used for
+ * @return string Identifier that should be used for
* module link creation
*/
- protected function get_module_identifier($basename, $id)
+ protected function get_module_identifier($basename)
{
if (strpos($basename, '\\') === false)
{
return $basename;
}
- return $id;
+ return str_replace('\\', '-', $basename);
}
/**
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index 1051021ea7..edca8ee1af 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -330,27 +330,6 @@ class metadata_manager
}
/**
- * Version validation helper
- *
- * @param string $string The string for comparing to a version
- * @param string $current_version The version to compare to
- * @return bool True/False if meets version requirements
- */
- private function _validate_version($string, $current_version)
- {
- // Allow them to specify their own comparison operator (ex: <3.1.2, >=3.1.0)
- $comparison_matches = false;
- preg_match('#[=<>]+#', $string, $comparison_matches);
-
- if (!empty($comparison_matches))
- {
- return version_compare($current_version, str_replace(array($comparison_matches[0], ' '), '', $string), $comparison_matches[0]);
- }
-
- return version_compare($current_version, $string, '>=');
- }
-
- /**
* Outputs the metadata into the template
*
* @return null
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 6bf6af1b78..082bea22f1 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -34,7 +34,7 @@
<fieldset id="display-panel" class="fields2" role="tabpanel">
<dl>
<dt><label for="posts_per_page">{L_POSTS_PER_PAGE}{L_COLON}</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt>
- <dd><input class="inputbox autowidth" type="number" min="1" name="posts_per_page" id="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></dd>
+ <dd><input class="inputbox autowidth" type="number" min="0" name="posts_per_page" id="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></dd>
</dl>
<dl>
<dt><label>{L_DISPLAY_POSTS}{L_COLON}</label></dt>
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index 5bd762ec0b..cba473147e 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -55,7 +55,7 @@
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_POSTS_PER_PAGE}</span><br /><span class="gensmall">{L_POSTS_PER_PAGE_EXPLAIN}</span></td>
- <td class="row2" colspan="2"><input class="post" type="number" min="1" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></td>
+ <td class="row2" colspan="2"><input class="post" type="number" min="0" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></td>
</tr>
<tr>
<td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>