From af9133e026a27b5007c268c4b6598a9b4d89ee31 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 7 May 2012 13:39:42 -0400 Subject: Ensure we don't save DOS style newlines from the textarea. --- config/systempatches/system_patches_edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/systempatches') diff --git a/config/systempatches/system_patches_edit.php b/config/systempatches/system_patches_edit.php index bfa0af36..32318620 100644 --- a/config/systempatches/system_patches_edit.php +++ b/config/systempatches/system_patches_edit.php @@ -100,7 +100,8 @@ if ($_POST) { $thispatch['descr'] = $_POST['descr']; $thispatch['location'] = patch_fixup_url($_POST['location']); if (!empty($_POST['patch'])) { - $thispatch['patch'] = base64_encode($_POST['patch']); + /* Strip DOS style carriage returns from textarea input */ + $thispatch['patch'] = base64_encode(str_replace("\r", "", $_POST['patch'])); } if (is_github_url($thispatch['location']) && ($_POST['pathstrip'] == 0)) $thispatch['pathstrip'] = 1; -- cgit v1.2.3