mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-50260 lib: remove unnecessary isset check in optional_param().
There is no need to do check: if (!isset($default)) As we're guaranteed that function was called with 3 arguments (func_num_args() == 3).
This commit is contained in:
parent
803f565753
commit
75aefe070b
1 changed files with 0 additions and 3 deletions
|
@ -623,9 +623,6 @@ function optional_param($parname, $default, $type) {
|
|||
if (func_num_args() != 3 or empty($parname) or empty($type)) {
|
||||
throw new coding_exception('optional_param requires $parname, $default + $type to be specified (parameter: '.$parname.')');
|
||||
}
|
||||
if (!isset($default)) {
|
||||
$default = null;
|
||||
}
|
||||
|
||||
// POST has precedence.
|
||||
if (isset($_POST[$parname])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue