Commit 3f6c7f80 authored by Daniel Parejo's avatar Daniel Parejo Committed by Robert Lyon
Browse files

Bug 1359109: Fail deleting long group names



Patch originally submitted by Daniel Parejo in bug report

Change-Id: I33d3d9c6ff12c69ef871de47fe15524659ceba36
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8be3efdf
...@@ -811,11 +811,15 @@ function group_delete($groupid, $shortname=null, $institution=null, $notifymembe ...@@ -811,11 +811,15 @@ function group_delete($groupid, $shortname=null, $institution=null, $notifymembe
), ),
)); ));
} }
// make sure the group name + deleted suffix will fit within 128 chars
$delete_name = $group->name;
if (strlen($delete_name) > 100) {
$delete_name = substr($delete_name, 0, 100) . '(...)';
}
update_record('group', update_record('group',
array( array(
'deleted' => 1, 'deleted' => 1,
'name' => $group->name . '.deleted.' . time(), 'name' => $delete_name . '.deleted.' . time(),
'shortname' => null, 'shortname' => null,
'institution' => null, 'institution' => null,
'category' => null, 'category' => null,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment