aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/extension/metadata_manager.php33
1 files changed, 20 insertions, 13 deletions
diff --git a/phpBB/includes/extension/metadata_manager.php b/phpBB/includes/extension/metadata_manager.php
index 0e0b609a68..c5e9baf1e7 100644
--- a/phpBB/includes/extension/metadata_manager.php
+++ b/phpBB/includes/extension/metadata_manager.php
@@ -232,22 +232,29 @@ class phpbb_extension_metadata_manager
*/
public function validate_metadata_array()
{
- $validate = array(
- 'name',
- 'type',
- 'licence',
- 'description',
- 'version',
- 'extra_display-name',
- );
-
- foreach ($validate as $type)
+ foreach ($this->validation as $name => $regex)
{
- $type = 'validate_' . $type;
+ if (is_array($regex))
+ {
+ foreach ($regex as $extra_name => $extra_regex)
+ {
+ $type = 'validate_' . $name . '_' . $extra_name;
- if (!$this->$type())
+ if (!$this->$type())
+ {
+ return false;
+ }
+ }
+ }
+ else
{
- return false;
+
+ $type = 'validate_' . $name;
+
+ if (!$this->$type())
+ {
+ return false;
+ }
}
}