X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FStubObject.php;h=adca862c935571af74351818213694efd3674110;hb=937a0ffa361a17722c07e7dfbc35ab04f645c381;hp=8878660b7303be83ea3f6df91d727d523d29db78;hpb=9a6abb22e33ad039455ab660873b001952dcd6b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/StubObject.php b/includes/StubObject.php index 8878660b73..adca862c93 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -110,7 +110,11 @@ class StubObject { * @return object */ public function _newObject() { - return MWFunction::newObj( $this->class, $this->params ); + return ObjectFactory::getObjectFromSpec( array( + 'class' => $this->class, + 'args' => $this->params, + 'closure_expansion' => false, + ) ); } /** @@ -178,6 +182,24 @@ class StubUserLang extends StubObject { return $this->_call( $name, $args ); } + /** + * Call Language::findVariantLink after unstubbing $wgLang. + * + * This method is implemented with a full signature rather than relying on + * __call so that the pass-by-reference signature of the proxied method is + * honored. + * + * @param string &$link The name of the link + * @param Title &$nt The title object of the link + * @param bool $ignoreOtherCond To disable other conditions when + * we need to transclude a template or update a category's link + */ + public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { + global $wgLang; + $this->_unstub( 'findVariantLink', 3 ); + return $wgLang->findVariantLink( $link, $nt, $ignoreOtherCond ); + } + /** * @return Language */