close
Skip to content

Issue 48 Minify regex rewrite rule broken by external plugin / theme#49

Merged
westonruter merged 7 commits into
masterfrom
issue-48
Dec 12, 2013
Merged

Issue 48 Minify regex rewrite rule broken by external plugin / theme#49
westonruter merged 7 commits into
masterfrom
issue-48

Conversation

@c3mdigital

Copy link
Copy Markdown
Contributor

This solves the issue by adding the minify rewrite rule to the end of the rewrite_rules_array insuring in theory that the rule can not be broken by an external rewrite filter.

@westonruter please reivew

Chris Olbekson added 2 commits November 26, 2013 12:07
- Change add_rewrite_rule to a filter for the rewrite_rules_array to insure additional plugins will not cause the rules to break
- Fixes #48
Comment thread dependency-minification.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3mdigital I believe this needs to be array_merge(), as using + does some strange things where it will skip merging a item from the right array, if it has the same numeric index as an item in the left.

@c3mdigital

Copy link
Copy Markdown
Contributor Author

@westonruter Yes array_merge is the way to go. Fixed in 98094cc

- Allows plugin to work with other plugins or themes who have filtered home_url
Comment thread dependency-minification.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3mdigital it seems I need to reverse the order here, so that $new_rules will appear at the top. Otherwise, on one site I'm getting the page rewrite rule matching before the the minification rewrite rule can be reached.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3mdigital good idea!

westonruter added a commit that referenced this pull request Dec 12, 2013
Fix rewrite rule broken by filtering home_url
@westonruter westonruter merged commit 77f3d99 into master Dec 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants