Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0
-
None
-
MOODLE_30_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
Description
I am little bit worried about the code like
if ($solo == 'true') {
|
$SESSION->todo = null;
|
}
|
if ($t) {
|
$SESSION->start = $t;
|
}
|
if ($first == 1) {
|
$SESSION->todo = $SESSION->no_history;
|
}
|
If you really need to use $SESSION (the MUC might be cleaner), let me suggest to properly namespace all your session variables in a common object, like $SESSION->mod_domoscio->foobar
Please avoid non-english inline comments (taky by se vám nelíbilo, kdybych vám psal komentáře jako je tento to help others to understand your code.
Finally, things like this are valid in PHP, yet it does not mean they help to understand your intention:
$solo = optional_param('solo', false, PARAM_INT); // Si test unitaire
|
if ($solo == 'true') {
|
...
|
}
|
Note you declare the parameter as integer, set boolean false as its default value and finally compare it with a string. Please do not do such things, it hurts