From 4ac65f4a10a0fe51b2549b2e4c84945248df9181 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 4 Apr 2006 00:51:47 +0000 Subject: [PATCH] Control those newlines. Props to that Andy guy. fixes #1082 git-svn-id: https://develop.svn.wordpress.org/trunk@3688 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 432c9d7d4c..93cbe1c4c6 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1077,11 +1077,15 @@ function insert_with_markers($filename, $marker, $insertion) { $foundit = false; if ($markerdata) { $state = true; - foreach ($markerdata as $markerline) { + foreach ($markerdata as $n => $markerline) { if (strstr($markerline, "# BEGIN {$marker}")) $state = false; - if ($state) - fwrite($f, "{$markerline}\n"); + if ($state) { + if ( $n + 1 < count($markerdata) ) + fwrite($f, "{$markerline}\n"); + else + fwrite($f, "{$markerline}"); + } if (strstr($markerline, "# END {$marker}")) { fwrite($f, "# BEGIN {$marker}\n"); if (is_array($insertion))