X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=23bfd61cb0af7ae360d3cf1953e9f501cac77429;hb=5b943975bd020e1d9487a0bf5bc57f6b069230e0;hp=867b88b56cbb5688f0f82ba18608d52333831ff1;hpb=320c48058ef88d8950098be3cf088b4d9e0fff54;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index 867b88b56c..23bfd61cb0 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -159,9 +159,6 @@ class Linker { * link() replaces the old functions in the makeLink() family. * * @since 1.18 Method exists since 1.16 as non-static, made static in 1.18. - * You can call it using this if you want to keep compat with these: - * $linker = class_exists( 'DummyLinker' ) ? new DummyLinker() : new Linker(); - * $linker->link( ... ); * * @param $target Title Can currently only be a Title, but this may * change to support Images, literal URLs, etc. @@ -281,9 +278,9 @@ class Linker { wfProfileIn( __METHOD__ ); # We don't want to include fragments for broken links, because they # generally make no sense. - if ( in_array( 'broken', $options ) && $target->mFragment !== '' ) { + if ( in_array( 'broken', $options ) && $target->hasFragment() ) { $target = clone $target; - $target->mFragment = ''; + $target->setFragment( '' ); } # If it's a broken link, add the appropriate query pieces, unless @@ -387,7 +384,7 @@ class Linker { // If the target is just a fragment, with no title, we return the fragment // text. Otherwise, we return the title text itself. - if ( $target->getPrefixedText() === '' && $target->getFragment() !== '' ) { + if ( $target->getPrefixedText() === '' && $target->hasFragment() ) { return htmlspecialchars( $target->getFragment() ); } return htmlspecialchars( $target->getPrefixedText() ); @@ -451,8 +448,7 @@ class Linker { if ( !$name ) { return $title; } - $ret = SpecialPage::getTitleFor( $name, $subpage ); - $ret->mFragment = $title->getFragment(); + $ret = SpecialPage::getTitleFor( $name, $subpage, $title->getFragment() ); return $ret; } else { return $title;