X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fspecialpage%2FSpecialPage.php;h=00d8c4a4c475e4bd45e50480290dece74cf03818;hb=dcdb8e463e3b2be121c61c91df13ea36d270a602;hp=99b9f33d4c43d28ce864fbf619df21e515506563;hpb=2cd0b5a90ef408dfb972d94b68180181005b5555;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/SpecialPage.php b/includes/specialpage/SpecialPage.php index 99b9f33d4c..00d8c4a4c4 100644 --- a/includes/specialpage/SpecialPage.php +++ b/includes/specialpage/SpecialPage.php @@ -67,6 +67,8 @@ class SpecialPage { /** * Get a localised Title object for a specified special page name + * If you don't need a full Title object, consider using TitleValue through + * getTitleValueFor() below. * * @since 1.9 * @since 1.21 $fragment parameter added @@ -78,9 +80,24 @@ class SpecialPage { * @throws MWException */ public static function getTitleFor( $name, $subpage = false, $fragment = '' ) { + return Title::newFromTitleValue( + self::getTitleValueFor( $name, $subpage, $fragment ) + ); + } + + /** + * Get a localised TitleValue object for a specified special page name + * + * @since 1.28 + * @param string $name + * @param string|bool $subpage Subpage string, or false to not use a subpage + * @param string $fragment The link fragment (after the "#") + * @return TitleValue + */ + public static function getTitleValueFor( $name, $subpage = false, $fragment = '' ) { $name = SpecialPageFactory::getLocalNameFor( $name, $subpage ); - return Title::makeTitle( NS_SPECIAL, $name, $fragment ); + return new TitleValue( NS_SPECIAL, $name, $fragment ); } /**