X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/a4b7bc30be63caf1ec27cac03f30f5b59eb60dc5..f3d5217b16e98e6c6d68a5286d6c9a1f4328b929:/login/edit.php diff --git a/login/edit.php b/login/edit.php index 99afb13..e60cf59 100644 --- a/login/edit.php +++ b/login/edit.php @@ -57,7 +57,7 @@ foreach ($cols as $col => &$colconf) { $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 @@ -122,6 +122,9 @@ if ($_POST) { } 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."; }