Opened 20 years ago
Closed 19 years ago
#1082 closed defect (bug) (fixed)
Superfluous newlines added to .htaccess on update
Reported by: | Blu_Matt | Owned by: | ryan |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | minor | Version: | 2.0 |
Component: | General | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
After a page update, when only the content has changed (i.e. no change to the page slug or choice of parent page) the .htaccess gets rewritten, undoing any customisations.
Attachments (1)
Change History (10)
#3
@
19 years ago
- Keywords bg|has-patch added
- Milestone changed from 2.0 to 2.0.1
- Owner changed from anonymous to ryan
- Severity changed from enhancement to minor
Attached stunt-htaccess.diff fixes the newline issue.
If you are customizing .htaccess between the WordPress markers, you are cutting your own throat if you don't do it programmatically. Use the API or make the file unwritable.
#6
@
19 years ago
- Component changed from Optimization to General
- Summary changed from .htaccess rewritten after trivial page update to Superfluous newlines added to .htaccess on update
As the main point of this ticket seems to have moved from the fact that .htaccess is updated to that when it is updated, extra newlines are added (and the included patch fixes this), I have updated the summary accordingly.
This bug can be reproduced by clicking "Update Permanlink Structure >>" in "Customize Permalink Structure", even if no changes are made to the settings. This appears to be fixed by the attached patch.
#8
@
19 years ago
- Keywords has-patch commit added; bg|has-patch bg|needs-testing bg|commit removed
I may be playing semantics but the reasoning is that the code should be checking if the N-th element in the array is the second to last element not if the N+1-th element is the last element.
This may be a little more meaninful:
+ if ($state) { + fwrite($f, "{$markerline}"); + if ( $n < count($markerdata) - 1) + fwrite($f, "\n"); + }
Either, this seems ready for a commit.
I experience something similar: it adds blank lines everytime a page is edited (edited or moved). Eg every time I edit the content or move a page it adds 1 blank line, thus adding 1 byte.