mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Do not use set_default() and isset_param(), becasue those ugly hacks will be removed SOON!!
This commit is contained in:
parent
d9d0456f51
commit
4d7c4f7f5c
1 changed files with 2 additions and 9 deletions
|
@ -263,10 +263,7 @@ function optional_param($varname, $default=NULL, $options=PARAM_CLEAN) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to test if a parameter is set
|
* HACK ALERT! Do not use this function, it will be removed soon!!
|
||||||
*
|
|
||||||
* @param string $varname The name of the parameter being checked
|
|
||||||
* @return bool Returns true if the parameter set, otherwise false
|
|
||||||
*/
|
*/
|
||||||
function isset_param($varname) {
|
function isset_param($varname) {
|
||||||
if (isset($_GET[$varname])) {
|
if (isset($_GET[$varname])) {
|
||||||
|
@ -538,11 +535,7 @@ function optional_variable(&$var, $default=0) {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If a variable is empty set it to the default
|
* HACK ALERT! Do not use this function, it will be removed soon!!
|
||||||
* otherwise leave it alone
|
|
||||||
* @param mixed $var the variable to test
|
|
||||||
* @param mixed $default the default value
|
|
||||||
* @return bool true if variable has changed
|
|
||||||
*/
|
*/
|
||||||
function set_default( &$var, $default ) {
|
function set_default( &$var, $default ) {
|
||||||
if (empty($var)) {
|
if (empty($var)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue