[wp-trac] [WordPress Trac] #16971: Creation of .htaccess file leads to a 500 Error
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 26 13:52:22 UTC 2011
#16971: Creation of .htaccess file leads to a 500 Error
------------------------------------+------------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.0.5
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Comment (by hakre):
The flow in that function could be simplified to first check if a file
exists or not and handle everything related to file creation upfront.
See the example attached which demonstrates this next to the following:
Then the replacement of the area(s) defined by $marker could be buffered
and thanks to that simplified as well.
The second benefit of a buffer is that it can be written buffered to disc
reducing I/O.
The function can benefit from defining the input variables, it's a bit
unclear if $insertion must or can be an array. Not addressed in the
example, just came to my mind.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16971#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list