Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php |
— | — | @@ -154,12 +154,6 @@ |
155 | 155 | } |
156 | 156 | |
157 | 157 | public function getAllowedParams() { |
158 | | - global $wgUrlProtocols; |
159 | | - $protocols = array( '' ); |
160 | | - foreach ( $wgUrlProtocols as $p ) { |
161 | | - $protocols[] = substr( $p, 0, strpos( $p, ':' ) ); |
162 | | - } |
163 | | - |
164 | 158 | return array( |
165 | 159 | 'prop' => array( |
166 | 160 | ApiBase::PARAM_ISMULTI => true, |
— | — | @@ -174,7 +168,7 @@ |
175 | 169 | ApiBase::PARAM_TYPE => 'integer' |
176 | 170 | ), |
177 | 171 | 'protocol' => array( |
178 | | - ApiBase::PARAM_TYPE => $protocols, |
| 172 | + ApiBase::PARAM_TYPE => self::prepareProtocols(), |
179 | 173 | ApiBase::PARAM_DFLT => '', |
180 | 174 | ), |
181 | 175 | 'query' => null, |
— | — | @@ -192,6 +186,15 @@ |
193 | 187 | ); |
194 | 188 | } |
195 | 189 | |
| 190 | + public static function prepareProtocols() { |
| 191 | + global $wgUrlProtocols; |
| 192 | + $protocols = array( '' ); |
| 193 | + foreach ( $wgUrlProtocols as $p ) { |
| 194 | + $protocols[] = substr( $p, 0, strpos( $p, ':' ) ); |
| 195 | + } |
| 196 | + return $protocols; |
| 197 | + } |
| 198 | + |
196 | 199 | public function getParamDescription() { |
197 | 200 | $p = $this->getModulePrefix(); |
198 | 201 | return array( |