+ // Allow forcing an interstitial for local interwikis. This is used
+ // when a redirect page is reached via a special page which resolves
+ // to a user-dependent value (as defined by
+ // RedirectSpecialPage::personallyIdentifiableTarget). See the hack
+ // for avoiding T109724 in MediaWiki::performRequest (which also
+ // explains why we can't use a query parameter instead).
+ //
+ // HHVM dies when substr_compare is used on an empty string so ensure it's not.
+ $force = ( substr_compare( $par ?: 'x', 'force/', 0, 6 ) === 0 );
+ if ( $force ) {
+ $par = substr( $par, 6 );
+ }
+