Permalink
Browse files

Use aarray key exists instead of isset. It's what we're really testin…

…g for.

This also eliminates string concatenation inside of an array key.
  • Loading branch information...
1 parent 8501819 commit bca7f689c44b1bea2b2f334e0965251d0d9a51fe @VSEphpbb VSEphpbb committed Jun 16, 2016
Showing with 3 additions and 3 deletions.
  1. +3 −3 controller/main.php
View
6 controller/main.php
@@ -117,7 +117,7 @@ public function handle()
$this->template->assign_block_vars('extension', array(
'NAME' => $value,
'DESC' => $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_UI'),
- 'DESC_EXPLAIN' => isset($this->user->lang['SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN']) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
+ 'DESC_EXPLAIN' => array_key_exists('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN', $this->user->lang) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
'VALUE' => $this->request->variable($value, (string) $default),
));
}
@@ -136,7 +136,7 @@ public function handle()
$this->template->assign_block_vars('author', array(
'NAME' => $value,
'DESC' => $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_UI'),
- 'DESC_EXPLAIN' => isset($this->user->lang['SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN']) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
+ 'DESC_EXPLAIN' => array_key_exists('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN', $this->user->lang) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
'VALUE' => isset($author_values[$value][$i]) ? $author_values[$value][$i] : '',
));
}
@@ -147,7 +147,7 @@ public function handle()
$this->template->assign_block_vars('requirement', array(
'NAME' => $value,
'DESC' => $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_UI'),
- 'DESC_EXPLAIN' => isset($this->user->lang['SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN']) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
+ 'DESC_EXPLAIN' => array_key_exists('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN', $this->user->lang) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
'VALUE' => $this->request->variable($value, (string) $default),
));
}

0 comments on commit bca7f68

Please sign in to comment.