30 private $mCanonicalServer;
42 $this->mCanonicalServer = $canonicalServer;
44 $this->mServer = $server ?? $canonicalServer;
54 $host = parse_url( $this->mCanonicalServer, PHP_URL_HOST );
60 return $this->mCanonicalServer;
75 private function getLocalUrl( $page, $fragmentId =
null ) {
76 $page =
wfUrlencode( str_replace(
' ',
'_', $page ) );
78 if ( is_string( $fragmentId ) && $fragmentId !==
'' ) {
82 return str_replace(
'$1', $page, $this->mPath );
94 return $this->mCanonicalServer . $this->getLocalUrl( $page, $fragmentId );
102 return $this->mCanonicalServer;
112 public function getUrl( $page, $fragmentId =
null ) {
126 return $this->mServer . $this->getLocalUrl( $page, $fragmentId );
133class_alias( WikiReference::class,
'WikiReference' );
wfUrlencode( $s)
We want some things to be included as literal characters in our title URLs for prettiness,...