* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( "ApiQueryBase.php" );
-}
-
/**
* A query module to list all external URLs found on a given set of pages.
*
$this->addOption( 'ORDER BY', 'el_from' );
}
+ // If we're querying all protocols, use DISTINCT to avoid repeating protocol-relative links twice
+ if ( $protocol === null ) {
+ $this->addOption( 'DISTINCT' );
+ }
+
$this->addOption( 'LIMIT', $params['limit'] + 1 );
$offset = isset( $params['offset'] ) ? $params['offset'] : 0;
if ( $offset ) {
) );
}
- protected function getExamples() {
+ public function getExamples() {
return array(
- 'Get a list of external links on the [[Main Page]]:',
- ' api.php?action=query&prop=extlinks&titles=Main%20Page',
+ 'api.php?action=query&prop=extlinks&titles=Main%20Page' => 'Get a list of external links on the [[Main Page]]',
);
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Properties#extlinks_.2F_el';
+ return 'https://www.mediawiki.org/wiki/API:Properties#extlinks_.2F_el';
}
public function getVersion() {