diff options
author | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2012-01-14 14:27:46 +0000 |
---|---|---|
committer | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2012-01-14 14:27:46 +0000 |
commit | caf5df17aba64eb980a12f596ce98ec1f476c801 (patch) | |
tree | 7b1f1964e071ce6ccd09e082fdd4e9df1e7afb9b /includes/context/IContextSource.php | |
parent | 1de5c4d1a115fed087521280b51d45d3d206d47f (diff) | |
download | mediawikicore-caf5df17aba64eb980a12f596ce98ec1f476c801.tar.gz mediawikicore-caf5df17aba64eb980a12f596ce98ec1f476c801.zip |
Per Aaron, fix for r108274: added canUseWikiPage() to context objects to know whether getWikiPage() can be safely called
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/108902
Diffstat (limited to 'includes/context/IContextSource.php')
-rw-r--r-- | includes/context/IContextSource.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/includes/context/IContextSource.php b/includes/context/IContextSource.php index ed7aba03594f..476035b525ee 100644 --- a/includes/context/IContextSource.php +++ b/includes/context/IContextSource.php @@ -43,7 +43,20 @@ interface IContextSource { public function getTitle(); /** - * Get the WikiPage object + * Check whether a WikiPage object can be get with getWikiPage(). + * Callers should expect that an exception is thrown from getWikiPage() + * if this method returns false. + * + * @since 1.19 + * @return bool + */ + public function canUseWikiPage(); + + /** + * Get the WikiPage object. + * May throw an exception if there's no Title object set or the Title object + * belongs to a special namespace that doesn't have WikiPage, so use first + * canUseWikiPage() to check whether this method can be called safely. * * @since 1.19 * @return WikiPage |