Index: trunk/phase3/includes/context/RequestContext.php |
— | — | @@ -146,8 +146,9 @@ |
147 | 147 | /** |
148 | 148 | * Accepts a language code and ensures it's sane. Outputs a cleaned up language |
149 | 149 | * code and replaces with $wgLanguageCode if not sane. |
| 150 | + * @private |
150 | 151 | */ |
151 | | - private static function sanitizeLangCode( $code ) { |
| 152 | + static function sanitizeLangCode( $code ) { |
152 | 153 | global $wgLanguageCode; |
153 | 154 | |
154 | 155 | // BCP 47 - letter case MUST NOT carry meaning |
— | — | @@ -176,6 +177,7 @@ |
177 | 178 | * Set the Language object |
178 | 179 | * |
179 | 180 | * @param $l Mixed Language instance or language code |
| 181 | + * @since 1.19 |
180 | 182 | */ |
181 | 183 | public function setLanguage( $l ) { |
182 | 184 | if ( $l instanceof Language ) { |
— | — | @@ -201,6 +203,7 @@ |
202 | 204 | * Get the Language object |
203 | 205 | * |
204 | 206 | * @return Language |
| 207 | + * @since 1.19 |
205 | 208 | */ |
206 | 209 | public function getLanguage() { |
207 | 210 | if ( $this->lang === null ) { |
Index: trunk/phase3/includes/context/IContextSource.php |
— | — | @@ -68,6 +68,7 @@ |
69 | 69 | * Get the Language object |
70 | 70 | * |
71 | 71 | * @return Language |
| 72 | + * @since 1.19 |
72 | 73 | */ |
73 | 74 | public function getLanguage(); |
74 | 75 | |
Index: trunk/phase3/includes/context/ContextSource.php |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | * Get the Language object |
109 | 109 | * |
110 | 110 | * @return Language |
| 111 | + * @since 1.19 |
111 | 112 | */ |
112 | 113 | public function getLanguage() { |
113 | 114 | return $this->getContext()->getLanguage(); |
Index: trunk/phase3/includes/context/DerivativeContext.php |
— | — | @@ -169,12 +169,13 @@ |
170 | 170 | * Set the Language object |
171 | 171 | * |
172 | 172 | * @param $l Mixed Language instance or language code |
| 173 | + * @since 1.19 |
173 | 174 | */ |
174 | 175 | public function setLanguage( $l ) { |
175 | 176 | if ( $l instanceof Language ) { |
176 | 177 | $this->lang = $l; |
177 | 178 | } elseif ( is_string( $l ) ) { |
178 | | - $l = self::sanitizeLangCode( $l ); // FIXME: Undefined method, is at RequestContext::sanitizeLangCode() |
| 179 | + $l = RequestContext::sanitizeLangCode( $l ); |
179 | 180 | $obj = Language::factory( $l ); |
180 | 181 | $this->lang = $obj; |
181 | 182 | } else { |
— | — | @@ -194,6 +195,7 @@ |
195 | 196 | * Get the Language object |
196 | 197 | * |
197 | 198 | * @return Language |
| 199 | + * @since 1.19 |
198 | 200 | */ |
199 | 201 | public function getLanguage() { |
200 | 202 | if ( !is_null( $this->lang ) ) { |