$colpath = $user['dir'] . '/' . $colconf['filename'];
if (file_exists($colpath)) {
$colconf['value'] = $filetype != 'txt' ? '' :
- file_get_contents($colpath);
+ rtrim(file_get_contents($colpath));
}
if (file_exists($user['dir']) and !is_writable($user['dir'])) {
continue; # locked parent directory
}
continue;
}
+ if (@$cols[$col]['type'] != 'file') {
+ $val .= "\n"; # eol in text files
+ }
if (file_put_contents($cols[$col]['target'], $val) === FALSE) {
$colwarn[$col] = "Fout bij opslaan.";
}
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
- 'pattern' => @$colconf['pattern'] ?: FALSE,
- 'size' => @$colconf['size'] ?: FALSE,
- ];
- if (@$colconf['type'] == 'file') {
- $attrs['accept'] = "image/jpeg";
- }
+ ] + (@$colconf['attr'] ?: []);
print '<input';
foreach ($attrs as $attr => $attrval) {