Index: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | $this->addSpecificMapHTML( $parser ); |
100 | 100 | |
101 | 101 | global $wgTitle; |
102 | | - if ( $wgTitle->getNamespace() == NS_SPECIAL ) { |
| 102 | + if ( !is_null( $wgTitle ) && $wgTitle->getNamespace() == NS_SPECIAL ) { |
103 | 103 | global $wgOut; |
104 | 104 | $this->service->addDependencies( $wgOut ); |
105 | 105 | } |
— | — | @@ -113,14 +113,12 @@ |
114 | 114 | * Fills the $markerData array with the locations and their meta data. |
115 | 115 | */ |
116 | 116 | private function setMarkerData( Parser $parser, PPFrame $frame = null ) { |
117 | | - global $wgTitle; |
118 | | - |
119 | 117 | // New parser object to render popup contents with. |
120 | | - $parser = new Parser(); |
| 118 | + $parser = clone $parser; |
| 119 | + |
| 120 | + $this->title = $parser->parse( $this->title, $parser->getTitle(), new ParserOptions() )->getText(); |
| 121 | + $this->label = $parser->parse( $this->label, $parser->getTitle(), new ParserOptions() )->getText(); |
121 | 122 | |
122 | | - $this->title = $parser->parse( $this->title, $wgTitle, new ParserOptions() )->getText(); |
123 | | - $this->label = $parser->parse( $this->label, $wgTitle, new ParserOptions() )->getText(); |
124 | | - |
125 | 123 | // Each $args is an array containg the coordinate set as first element, possibly followed by meta data. |
126 | 124 | foreach ( $this->coordinates as $args ) { |
127 | 125 | $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $args ) ); |
— | — | @@ -131,11 +129,11 @@ |
132 | 130 | |
133 | 131 | if ( count( $args ) > 0 ) { |
134 | 132 | // Parse and add the point specific title if it's present. |
135 | | - $markerData['title'] = $parser->parse( $args[0], $wgTitle, new ParserOptions() )->getText(); |
| 133 | + $markerData['title'] = $parser->parse( $args[0], $parser->getTitle(), new ParserOptions() )->getText(); |
136 | 134 | |
137 | 135 | if ( count( $args ) > 1 ) { |
138 | 136 | // Parse and add the point specific label if it's present. |
139 | | - $markerData['label'] = $parser->parse( $args[1], $wgTitle, new ParserOptions() )->getText(); |
| 137 | + $markerData['label'] = $parser->parse( $args[1], $parser->getTitle(), new ParserOptions() )->getText(); |
140 | 138 | |
141 | 139 | if ( count( $args ) > 2 ) { |
142 | 140 | // Add the point specific icon if it's present. |
Index: trunk/extensions/Maps/includes/features/Maps_BaseMap.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | global $wgTitle; |
86 | | - if ( $wgTitle->getNamespace() == NS_SPECIAL ) { |
| 86 | + if ( !is_null( $wgTitle ) && $wgTitle->getNamespace() == NS_SPECIAL ) { |
87 | 87 | global $wgOut; |
88 | 88 | $this->service->addDependencies( $wgOut ); |
89 | 89 | } |