[wp-trac] [WordPress Trac] #9716: Wordpress Theme/Plugin editor adds blank lines

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 7 01:06:22 UTC 2011


#9716: Wordpress Theme/Plugin editor adds blank lines
-----------------------------------------+------------------------------
 Reporter:  Vistronic                    |       Owner:  anonymous
     Type:  defect (bug)                 |      Status:  reopened
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Editor                       |     Version:  3.2.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |
-----------------------------------------+------------------------------
Changes (by kurtpayne):

 * keywords:  has-patch => has-patch reporter-feedback


Comment:

 [[attachment:9716.patch]] may not undo the "double line" problem you're
 seeing, harmr.  The file is read off the file system (using
 file_get_contents), presented in the browser (very dependent upon your
 browser + OS), then posted back to the server, and written back using
 fopen/fwrite.

 Somewhere in that process, the line endings are being translated
 incorrectly.  WordPress is using common practices for working with text
 files in the web, but this patch should give you a choice as to how the
 line endings are translated when they written back to the server.  The
 fopen mode in the patch has been changed, too, to prevent any unexpected
 EOL translation.

 There's some conflicting notes on the
 [http://us.php.net/manual/en/function.fopen.php fopen documentation page]
 about using 't' and 'b' modes depending on your goals.

 Please report back if this helps resolve the problem going forward,
 introduces new problems, undoes the old "double line" problem in existing
 files, etc.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9716#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list