[ticket/10631] Fixing some more issues

PHPBB3-10631
This commit is contained in:
Nathan Guse 2012-07-22 20:24:20 -05:00 committed by Unknown Bliss
parent 6b12f71b94
commit bf6e91b5f3
2 changed files with 111 additions and 110 deletions

View file

@ -4,8 +4,6 @@
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p>
<fieldset> <fieldset>
<legend>{L_EXT_DETAILS}</legend> <legend>{L_EXT_DETAILS}</legend>
<dl> <dl>
@ -41,8 +39,8 @@
<dd><p id="md_time">{MD_TIME}</p></dd> <dd><p id="md_time">{MD_TIME}</p></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="md_license">{L_LICENSE}:</label></dt> <dt><label for="md_license">{L_LICENCE}:</label></dt>
<dd><p id="md_license">{MD_LICENSE}</p></dd> <dd><p id="md_license">{MD_LICENCE}</p></dd>
</dl> </dl>
</fieldset> </fieldset>
@ -87,6 +85,8 @@
<dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd> <dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<br /><br />
<!-- END md_authors --> <!-- END md_authors -->
</fieldset> </fieldset>

View file

@ -82,7 +82,7 @@ class phpbb_extension_metadata_manager
if ($template_output) if ($template_output)
{ {
$this->output_template_data($template); $this->output_template_data();
} }
return $this->metadata; return $this->metadata;
@ -138,7 +138,7 @@ class phpbb_extension_metadata_manager
*/ */
private function clean_metadata_array() private function clean_metadata_array()
{ {
if (!$this->validate_name() || !$this->validate_type() || !$this->validate_license() || !$this->validate_description() || !$this->validate_version() || !$this->validate_require_phpbb() || !$this->validate_extra_display_name()) if (!$this->validate_name() || !$this->validate_type() || !$this->validate_licence() || !$this->validate_description() || !$this->validate_version() || !$this->validate_require_phpbb() || !$this->validate_extra_display_name())
{ {
return false; return false;
} }
@ -178,7 +178,7 @@ class phpbb_extension_metadata_manager
*/ */
private function validate_description() private function validate_description()
{ {
return preg_match('#^{10,}$#', $this->metadata['description']); return true;//preg_match('#^{10,}$#', $this->metadata['description']);
} }
/** /**
@ -196,10 +196,10 @@ class phpbb_extension_metadata_manager
* *
* @return boolean True when passes validation * @return boolean True when passes validation
*/ */
private function validate_license() private function validate_licence()
{ {
// Nothing to validate except existence // Nothing to validate except existence
return isset($this->metadata['version']); return isset($this->metadata['licence']);
} }
/** /**
@ -219,7 +219,7 @@ class phpbb_extension_metadata_manager
*/ */
private function validate_extra_display_name() private function validate_extra_display_name()
{ {
return preg_match('#^[a-zA-Z0-9_]{2,0}$#', $this->metadata['name']); return true;//preg_match('#^[a-zA-Z0-9_]{2,0}$#', $this->metadata['name']);
} }
/** /**
@ -328,28 +328,29 @@ class phpbb_extension_metadata_manager
* *
* @return null * @return null
*/ */
public function output_template_data(phpbb_template $template) public function output_template_data()
{ {
$template->assign_vars(array(
$this->template->assign_vars(array(
'MD_NAME' => htmlspecialchars($this->metadata['name']), 'MD_NAME' => htmlspecialchars($this->metadata['name']),
'MD_TYPE' => htmlspecialchars($this->metadata['type']), 'MD_TYPE' => htmlspecialchars($this->metadata['type']),
'MD_DESCRIPTION' => htmlspecialchars($this->metadata['description']), 'MD_DESCRIPTION' => htmlspecialchars($this->metadata['description']),
'MD_HOMEPAGE' => $this->metadata['homepage'], 'MD_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '',
'MD_VERSION' => htmlspecialchars($this->metadata['version']), 'MD_VERSION' => htmlspecialchars($this->metadata['version']),
'MD_TIME' => htmlspecialchars($this->metadata['time']), 'MD_TIME' => htmlspecialchars($this->metadata['time']),
'MD_LICENSE' => htmlspecialchars($this->metadata['license']), 'MD_LICENCE' => htmlspecialchars($this->metadata['licence']),
'MD_REQUIRE_PHP' => htmlspecialchars($this->metadata['require']['php']), 'MD_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
'MD_REQUIRE_PHPBB' => htmlspecialchars($this->metadata['require']['phpbb']), 'MD_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '',
'MD_DISPLAY_NAME' => htmlspecialchars($this->metadata['extra']['display-name']), 'MD_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
)); ));
foreach ($this->metadata['authors'] as $author) foreach ($this->metadata['authors'] as $author)
{ {
$template->assign_block_vars('md_authors', array( $this->template->assign_block_vars('md_authors', array(
'AUTHOR_NAME' => htmlspecialchars($author['name']), 'AUTHOR_NAME' => htmlspecialchars($author['name']),
'AUTHOR_EMAIL' => $author['email'], 'AUTHOR_EMAIL' => $author['email'],
'AUTHOR_HOMEPAGE' => $author['homepage'], 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
'AUTHOR_ROLE' => htmlspecialchars($author['role']), 'AUTHOR_ROLE' => (isset($author['role'])) ? htmlspecialchars($author['role']) : '',
)); ));
} }