/**
* Returns true if the title is inside one of the specified namespaces.
*
- * @param int|int[] $namespaces,... The namespaces to check for
+ * @param int|int[] ...$namespaces The namespaces to check for
* @return bool
* @since 1.19
- * @suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug, T191668#5263929
*/
- public function inNamespaces( /* ... */ ) {
- $namespaces = func_get_args();
+ public function inNamespaces( ...$namespaces ) {
if ( count( $namespaces ) > 0 && is_array( $namespaces[0] ) ) {
$namespaces = $namespaces[0];
}
* @return string String of the URL.
*/
public function getLocalURL( $query = '', $query2 = false ) {
- global $wgArticlePath, $wgScript, $wgServer, $wgRequest;
+ global $wgArticlePath, $wgScript, $wgServer, $wgRequest, $wgMainPageIsDomainRoot;
$query = self::fixUrlQueryArgs( $query, $query2 );
$url = $wgServer . $url;
}
}
+
+ if ( $wgMainPageIsDomainRoot && $this->isMainPage() && $query === '' ) {
+ return '/';
+ }
+
// Avoid PHP 7.1 warning from passing $this by reference
$titleRef = $this;
Hooks::run( 'GetLocalURL', [ &$titleRef, &$url, $query ] );