Commit 52d0cb03 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Save custom upload agreement when there is no 'uploadcopyright' record in the...


Save custom upload agreement when there is no 'uploadcopyright' record in the site_content table (bug #635828); run clean_html over upload agreement.
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 403fe723
......@@ -1186,7 +1186,12 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
$data->content = $values['customagreement'];
$data->mtime = db_format_timestamp(time());
$data->mauthor = $USER->get('id');
update_record('site_content', $data, 'name');
if (record_exists('site_content', 'name', $data->name)) {
update_record('site_content', $data, 'name');
}
else {
insert_record('site_content', $data);
}
}
public static function short_size($bytes, $abbr=false) {
......
......@@ -46,7 +46,7 @@
<th><label>{str tag='uploadfile' section='artefact.file'}</label></th>
<td>
<input type="checkbox" name="{$prefix}_notice" id="{$prefix}_notice" />
{$agreementtext}
{$agreementtext|clean_html|safe}
</td>
</tr>
<tr class="uploadform">
......
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