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: markjaquith 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)

htaccesscheck.diff (1.9 KB) - added by ldebrouwer 18 months ago.
htaccesscheckv2.diff (2.7 KB) - added by ldebrouwer 18 months ago.
htaccesscheck_extractmarkers.diff (2.7 KB) - added by ldebrouwer 18 months ago.

Download all attachments as: .zip

Change History (8)

  • Keywords has-patch reporter-feedback needs-testing added

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.

Attached an updated version that stays closer to what Mark requested.

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.

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.

Note: See TracTickets for help on using tickets.