Skip to content
Merged

Fixes #175

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controller/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function handle()
'NAME' => $value,
'DESC' => $this->language->lang('SKELETON_QUESTION_' . strtoupper($value) . '_UI'),
'DESC_EXPLAIN' => $this->language->is_set('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') ? $this->language->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
'VALUE' => isset($author_values[$value][$i]) ? $author_values[$value][$i] : '',
'VALUE' => $author_values[$value][$i] ?? '',
]);
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ protected function get_request_variable($value, $default, $array_key = null)
if ($array_key !== null)
{
$return_value = $this->request->variable($value, [$default]);
return isset($return_value[$array_key]) ? $return_value[$array_key] : $default;
return $return_value[$array_key] ?? $default;
}

return $this->request->variable($value, $default);
Expand Down
6 changes: 3 additions & 3 deletions helper/validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function validate_extension_homepage($value)
{
$value = $this->validate_generated_string($value, 'SKELETON_INVALID_EXTENSION_URL');

if ((string) $value !== '' && filter_var($value, FILTER_VALIDATE_URL) === false)
if ($value !== '' && filter_var($value, FILTER_VALIDATE_URL) === false)
{
throw new runtime_exception($this->language->lang('SKELETON_INVALID_EXTENSION_URL'));
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public function validate_author_homepage($value)
{
$value = $this->validate_generated_string($value, 'SKELETON_INVALID_AUTHOR_URL');

if ((string) $value !== '' && filter_var($value, FILTER_VALIDATE_URL) === false)
if ($value !== '' && filter_var($value, FILTER_VALIDATE_URL) === false)
{
throw new runtime_exception($this->language->lang('SKELETON_INVALID_AUTHOR_URL'));
}
Expand All @@ -207,7 +207,7 @@ public function validate_author_email($value)
{
$value = $this->validate_generated_string($value, 'SKELETON_INVALID_AUTHOR_EMAIL');

if ((string) $value !== '' && filter_var($value, FILTER_VALIDATE_EMAIL) === false)
if ($value !== '' && filter_var($value, FILTER_VALIDATE_EMAIL) === false)
{
throw new runtime_exception($this->language->lang('SKELETON_INVALID_AUTHOR_EMAIL'));
}
Expand Down
2 changes: 1 addition & 1 deletion template/twig/extension/skeleton_version_compare.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function version_compare()
$args = func_get_args();

// Strip out any prefixed junk in front of a version number
$regex = '/^[\D]*(\d.*)$/';
$regex = '/^\D*(\d.*)$/';
preg_match($regex, $args[0], $ver1);
preg_match($regex, $args[1], $ver2);

Expand Down