mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
nvl() function moved to deprecated - my +1 for removing it together with friends xxx_variable() from HEAD ;-)
This commit is contained in:
parent
953eb6f315
commit
5d776ecbfc
@ -74,6 +74,25 @@ function optional_variable(&$var, $default=0) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that a variable is set
|
||||
*
|
||||
* Return $var if it is defined, otherwise return $default,
|
||||
* This function is very similar to {@link optional_variable()}
|
||||
*
|
||||
* @param mixed $var the variable which may be unset
|
||||
* @param mixed $default the value to return if $var is unset
|
||||
* @return mixed
|
||||
*/
|
||||
function nvl(&$var, $default='') {
|
||||
global $CFG;
|
||||
|
||||
if (!empty($CFG->disableglobalshack)) {
|
||||
error( "The nvl() function is deprecated ($var, $default)." );
|
||||
}
|
||||
return isset($var) ? $var : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a user an admin
|
||||
*
|
||||
|
@ -136,25 +136,6 @@ function p($var, $strip=false) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ensure that a variable is set
|
||||
*
|
||||
* Return $var if it is defined, otherwise return $default,
|
||||
* This function is very similar to {@link optional_variable()}
|
||||
*
|
||||
* @param mixed $var the variable which may be unset
|
||||
* @param mixed $default the value to return if $var is unset
|
||||
* @return mixed
|
||||
*/
|
||||
function nvl(&$var, $default='') {
|
||||
global $CFG;
|
||||
|
||||
if (!empty($CFG->disableglobalshack)) {
|
||||
error( "The nvl() function is deprecated ($var, $default)." );
|
||||
}
|
||||
return isset($var) ? $var : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove query string from url
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user