Ticket #4018 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

wp-rewrite/save_mod_rewrite_rules doesn't clean up after itself

Reported by: m0n5t3r Assigned to: westi
Priority: normal Milestone: 2.3
Component: Administration Version: 2.1.2
Severity: normal Keywords: has-patch commit
Cc:

Description

when going back to the default URL scheme after using some sort of mod_rewrite permalinks, permalink_structure is emptied, everything works as expected;

however, the rewrite rules are not cleared from .htaccess, since save_mod_rewrite_rules relies on permalink_structure being not empty and will abort silently, causing all non-existent locations to be redirected to Wordpress, which may or may not be what the user wants (supposedly if they don't want mod_rewrite permalinks they'll also rely on the server to handle 404, etc)

The fix is a one-liner actually :)

Attachments

save_mod_rewrite_rules-fix.diff (0.5 kB) - added by m0n5t3r on 03/22/07 21:51:51.
fix for save_mod_rewrite_rules
4018.diff (1.5 kB) - added by westi on 07/10/07 08:18:41.
New version of save_mod_rewrite_rules

Change History

03/22/07 21:51:51 changed by m0n5t3r

  • attachment save_mod_rewrite_rules-fix.diff added.

fix for save_mod_rewrite_rules

07/10/07 08:18:20 changed by westi

  • owner changed from anonymous to westi.
  • status changed from new to assigned.

-1 to this fix.

We need to make the behaviour of save_mod_rewrite rules more obvious.

I'm attaching a new patch which makes the behaviour more explicit and adds some documentation.

Please test.

07/10/07 08:18:41 changed by westi

  • attachment 4018.diff added.

New version of save_mod_rewrite_rules

(follow-up: ↓ 3 ) 07/10/07 15:30:33 changed by m0n5t3r

works here as expected (trunk, r5795), but gathering everything in a gigantic expression doesn't really help readability

+0

(in reply to: ↑ 2 ) 07/10/07 15:57:31 changed by westi

  • keywords changed from has-patch to has-patch commit.

Replying to m0n5t3r:

works here as expected (trunk, r5795), but gathering everything in a gigantic expression doesn't really help readability

The point behind merging the current checks into the "gigantic expression" and including the comment on how the function works and what exactly we are trying to achieve and improve the maintainability of the code.

07/18/07 20:46:54 changed by westi

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5809]) Update .htaccess file when rewrite rules are deleted if it exists. Fixes #4018