Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MediawikiApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public static function newFromPage( $url ) {
$tempClient = new Client( array( 'headers' => array( 'User-Agent' => 'addwiki-mediawiki-client' ) ) );
$pageXml = new SimpleXMLElement( $tempClient->get( $url )->getBody() );
$rsdElement = $pageXml->xpath( 'head/link[@type="application/rsd+xml"][@href]' );
$rsdXml = new SimpleXMLElement( $tempClient->get( $rsdElement[0]->attributes()['href'] )->getBody() );
return self::newFromApiEndpoint( $rsdXml->service->apis->api->attributes()->apiLink->__toString() );
$rsdXml = new SimpleXMLElement( $tempClient->get( (string) $rsdElement[0]->attributes()['href'] )->getBody() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$tempClient? Who do I rage to about this? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect that would be me ;)

return self::newFromApiEndpoint( (string) $rsdXml->service->apis->api->attributes()->apiLink );
}

/**
Expand Down