Skip to content

Commit

Permalink
Fixes #18, checks for missing title when getting page history.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Safley committed May 26, 2011
1 parent f4119b9 commit f1e237f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Scripto/Document.php
Expand Up @@ -804,6 +804,12 @@ protected function _getPageHistory($title, $limit = 10, $startRevisionId = null)
'rvprop' => 'ids|flags|timestamp|user|comment|size') 'rvprop' => 'ids|flags|timestamp|user|comment|size')
); );
$page = current($response['query']['pages']); $page = current($response['query']['pages']);

// Return if the page has not been created.
if (array_key_exists('missing', $page)) {
return $revisions;
}

foreach ($page['revisions'] as $revision) { foreach ($page['revisions'] as $revision) {


$actionPattern = '/^(' . implode('|', $actions) . ').+$/'; $actionPattern = '/^(' . implode('|', $actions) . ').+$/';
Expand Down

0 comments on commit f1e237f

Please sign in to comment.