HomePhabricator

Fully fix a bad rule object aliasing issue custom remarkup rules

Description

Fully fix a bad rule object aliasing issue custom remarkup rules

Summary:
Fixes T10234. This is a more thorough fix.

Root issue is that some time around D13589, we started hitting an object cache for loadCustomInlineRules(), but didn't adjust the code to account for that.

So if a page created multiple similar engines, we'd return the same $rule object for multiple engines, call setEngine() on it with different engines, and then possibly try to render using an already-expired engine the second time through.

Instead, create a separate $rule object for each separate $engine.

Test Plan:
Repro is something like this:

  • Create a custominlinerule which uses an engine.
  • Purge the remarkup cache.
  • Load a page which uses the rule in two engines (e.g., in a revision description, and also in an inline comment).
  • Before change: second one could fatal. After change: clean load.

Reviewers: thoughtpolice, chad

Reviewed By: thoughtpolice, chad

Subscribers: thoughtpolice, eadler

Maniphest Tasks: T10234

Differential Revision: https://secure.phabricator.com/D15535