Bug 61298: Avoid need for cloning when using PHP preprocessor

Template parameters were processed asynchronously even when using the PHP
preprocessor. This is however not necessary, as all template parameters
encountered in that situation are undefined.

External link contents are parsed all the way to DOM to avoid them breaking up
the link. This includes sanitization, which destructively updates the tokens
(removes attributes). Combined with asynchronous parameter processing this
lead to the crash observed in bug 61298.

Change-Id: I5296fab7a0a3010a024a5765cd72d10102f4ba4b
Co-authored-by: Arlo Breault <abreault@wikimedia.org>
Co-authored-by: Gabriel Wicke <gwicke@wikimedia.org>
Merge "Bug 61298: Avoid need for cloning when using PHP preprocessor"