-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DOM instead of SimpleXml for parsing HTML
To get the RSD URL we parse a page's HTML, but this fails with SimpleXml when there are non-XML entities (etc.), so this changes MediawikiApi::newFromPage() to use the PHP DOM library instead. A new exception class 'RsdException' was added, the docblock was updated, and a test added. Bug: https://phabricator.wikimedia.org/T163527
- Loading branch information
Showing
3 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Mediawiki\Api; | ||
|
||
use Exception; | ||
|
||
/** | ||
* An exception raised when an issue is encountered with Really Simple Discovery. | ||
* @see https://en.wikipedia.org/wiki/Really_Simple_Discovery | ||
*/ | ||
class RsdException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters