Skip to content

Commit

Permalink
MBS-8802: Fix handling of title strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Feb 13, 2024
1 parent 9b283d9 commit 22c357e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions classes/boardmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ public function update_card(int $cardid, array $data): void {
];
// Do some extra sanitizing.
if (isset($data['title'])) {
$data['title'] = clean_param($data['title'], PARAM_TEXT);
$data['title'] = s($data['title']);
}
if (isset($data['description'])) {
$data['description'] = clean_param($data['description'], PARAM_CLEANHTML);
Expand Down Expand Up @@ -946,7 +946,7 @@ public function update_column(int $columnid, array $data): void {
'autohide' => $data['autohide'],
];
if (isset($data['title'])) {
$data['title'] = clean_param($data['title'], PARAM_TEXT);
$data['title'] = s($data['title']);
}
$columndata = [
'id' => $columnid,
Expand Down
8 changes: 3 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,15 @@ function kanban_inplace_editable($itemtype, $itemid, $newvalue) {

\mod_kanban\helper::check_permissions_for_user_or_group($boardmanager->get_board(), $context, $boardmanager->get_cminfo());

$newtitle = clean_param($newvalue, PARAM_TEXT);

if ($itemtype == 'card') {
$boardmanager->update_card($itemid, ['title' => $newtitle]);
$boardmanager->update_card($itemid, ['title' => $newvalue]);
}

if ($itemtype == 'column') {
$boardmanager->update_column($itemid, ['title' => $newtitle]);
$boardmanager->update_column($itemid, ['title' => $newvalue]);
}

return new \core\output\inplace_editable('mod_kanban', $itemtype, $itemid, true, $newtitle, $newtitle, null, '');
return new \core\output\inplace_editable('mod_kanban', $itemtype, $itemid, true, $newvalue, $newvalue, null, '');
}

/**
Expand Down

0 comments on commit 22c357e

Please sign in to comment.