Make WordPress Core

Opened 16 years ago

Last modified 2 weeks ago

#14991 new defect (bug)

extra_rules_top should take priority over extra_permastructs

Reported by: prettyboymp Owned by:
Priority: normal Milestone:
Component: Rewrite Rules Version: 3.1
Severity: normal Keywords: has-patch dev-feedback needs-unit-tests
Cc: Focuses:

Description

Since extra_rules_top are specifically added instead of generated like the those from the extra_permastructs which runs through generate_rewrite_ruls(), shouldn't the extra_rules_top take priority in conflicts?

Attachments (3)

14991.diff (874 bytes ) - added by prettyboymp 16 years ago.
14991.2.diff (967 bytes ) - added by prettyboymp 16 years ago.
made sure top rules stayed first
14991.3.diff (2.0 KB ) - added by prettyboymp 16 years ago.

Download all attachments as: .zip

Change History (12)

@prettyboymp
16 years ago

#1 @scribu
16 years ago

  • Keywords has-patch added

Makes sense.

#2 follow-up: @filosofo
16 years ago

Won't that put the "top" rules last?

#3 in reply to: ↑ 2 @prettyboymp
16 years ago

Replying to filosofo:

Won't that put the "top" rules last?

Good catch. Adding a new patch.

@prettyboymp
16 years ago

made sure top rules stayed first

#4 @dd32
16 years ago

  • Keywords needs-patch added; has-patch removed

Using array_reverse like that looks like an ugly hack to me, If i'm understanding this correctly, perhaps we can add the permastructs to a separate array, and then merge it after the loop?

Reseting to needs-patch given this will be stale now (I've changed that block)

@prettyboymp
16 years ago

#5 @prettyboymp
16 years ago

  • Keywords has-patch added; needs-patch removed

Added updated patch. I went with dd32's suggestion of using a separate array for permastructs.

I switched to using the '+' operator instead of array_merge in the final rule merging. I would think this is the effect that was originally desired when this when this was created.

#6 @markjaquith
16 years ago

  • Milestone Awaiting ReviewFuture Release

#7 @chriscct7
12 years ago

  • Keywords dev-feedback added

Patch is still good to merge, and I like the idea behind this one. Tagging for re-review

#8 @chriscct7
11 years ago

  • Keywords needs-unit-tests added

This ticket was mentioned in PR #12774 on WordPress/wordpress-develop by @sainathpoojary.


2 weeks ago
#9

Trac ticket: #14991

Note: See TracTickets for help on using tickets.