Permalink
Browse files

Merge branch 'MDL-33682_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents e9637ea + 4ee8661 commit 50c5d7ae6ddc430f73a0b4e928b1b56e66e69730 @stronk7 stronk7 committed Jun 12, 2012
View
@@ -62,7 +62,7 @@
case backup::TYPE_1SECTION :
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/backup:backupsection', $coursecontext);
- if (!empty($section->name)) {
+ if ((string)$section->name !== '') {
$sectionname = format_string($section->name, true, array('context' => $coursecontext));
$heading = get_string('backupsection', 'backup', $sectionname);
$PAGE->navbar->add($sectionname);
@@ -1027,7 +1027,7 @@ public function process_section($data) {
// Section exists, update non-empty information
} else {
$section->id = $secrec->id;
- if (empty($secrec->name)) {
+ if ((string)$secrec->name === '') {
$section->name = $data->name;
}
if (empty($secrec->summary)) {
@@ -139,7 +139,7 @@ public static function get_backup_section_task($format, $sectionid) {
throw new backup_task_exception('section_task_section_not_found', $sectionid);
}
- return new backup_section_task(empty($section->name) ? $section->section : $section->name, $sectionid);
+ return new backup_section_task((string)$section->name !== '' ? $section->section : $section->name, $sectionid);
}
/**
@@ -129,7 +129,7 @@ public function get_static_value() {
* @param string $label
*/
public function set_label($label) {
- if (empty($label) || $label !== clean_param($label, PARAM_TEXT)) {
+ if ((string)$label === '' || $label !== clean_param($label, PARAM_TEXT)) {
throw new base_setting_ui_exception('setting_invalid_ui_label');
}
$this->label = $label;

0 comments on commit 50c5d7a

Please sign in to comment.