Opened 18 months ago
Last modified 18 months ago
#19268 new defect (bug)
Even if .htaccess isn't writable, WP shouldn't prompt if there are no changes.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch reporter-feedback needs-testing |
| Cc: |
Description
When you visit the permalinks settings screen, and .htaccess isn't writable, it prompts you to manually update. But it does that even if the current rules it is suggesting are already present. It should only prompt if the rules it is suggesting are different from what you have.
Attachments (3)
Change History (8)
ldebrouwer — 18 months ago
comment:1
ldebrouwer — 18 months ago
- Keywords has-patch reporter-feedback needs-testing added
comment:2
SergeyBiryukov — 18 months ago
We could probably use extract_from_markers():
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/includes/misc.php#L21
ldebrouwer — 18 months ago
comment:3
ldebrouwer — 18 months ago
Attached an updated version that stays closer to what Mark requested.
ldebrouwer — 18 months ago
comment:4
ldebrouwer — 18 months ago
I also attached a version using extract_from_markers as Sergey suggested, however this requires exploding the newly generated rewrite rules which could be unfavorable.
comment:5
ldebrouwer — 18 months ago
Another possibility, for the extract_from_markers version, could be to use array_filter to filter out the empty line that is in there by default, however that could lead to a possible false positive for one of the lines.

Something like I've attached above? I have no clue if it would work for IIS in the same way ( depends on the structure and content of the web.config file I guess ). And maybe it should be moved to a separate function in the wp_rewrite class, but I feel like that should be discussed first.