Skip to content

Commit 5c9b20b

Browse files
committed
Require author name and ext display name
1 parent a519ee2 commit 5c9b20b

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

helper/validator.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public function __construct(user $user)
2525
$this->user = $user;
2626
}
2727

28+
public function validate_author_name($value)
29+
{
30+
if (strlen($value))
31+
{
32+
return $value;
33+
}
34+
35+
throw new \RuntimeException($this->user->lang('SKELETON_INVALID_AUTHOR_NAME'));
36+
}
37+
2838
public function validate_num_authors($value)
2939
{
3040
if (preg_match('#^\d+$#', $value) && $value > 0 && $value <= 20)
@@ -45,6 +55,16 @@ public function validate_extension_name($value)
4555
throw new \RuntimeException($this->user->lang('SKELETON_INVALID_EXTENSION_NAME'));
4656
}
4757

58+
public function validate_extension_display_name($value)
59+
{
60+
if (strlen($value))
61+
{
62+
return $value;
63+
}
64+
65+
throw new \RuntimeException($this->user->lang('SKELETON_INVALID_EXTENSION_NAME'));
66+
}
67+
4868
public function validate_extension_time($value)
4969
{
5070
if (preg_match('#^\d{4}\-\d{2}\-\d{2}$#', $value))

language/en/common.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@
9898
'SKELETON_TITLE_REQUIREMENT_INFO' => 'Requirements',
9999
'SKELETON_TITLE_COMPONENT_INFO' => 'Components',
100100

101+
'SKELETON_INVALID_AUTHOR_NAME' => 'The author name is required',
101102
'SKELETON_INVALID_EXTENSION_NAME' => 'The extension name you provided is invalid',
102103
'SKELETON_INVALID_EXTENSION_TIME' => 'The extension date you provided is invalid',
103-
'SKELETON_INVALID_EXTENSION_VERSION' => 'The extension version you provided is invalid',
104-
'SKELETON_INVALID_NUM_AUTHORS' => 'The number of authors you provided is invalid',
105-
'SKELETON_INVALID_VENDOR_NAME' => 'The vendor name you provided is invalid',
104+
'SKELETON_INVALID_EXTENSION_VERSION'=> 'The extension version you provided is invalid',
105+
'SKELETON_INVALID_NUM_AUTHORS' => 'The number of authors you provided is invalid',
106+
'SKELETON_INVALID_VENDOR_NAME' => 'The vendor name you provided is invalid',
106107
));

0 commit comments

Comments
 (0)