chnm / Scripto

Scripto is an open source documentary transcription tool library written in PHP.
34 stars 6 forks source link

Uncreated pages have no page history #18

Closed jimsafley closed 13 years ago

jimsafley commented 13 years ago

Scripto_Service_MediaWiki::getRevisions() returns the following array when a page is not yet created:

(
  [query] => Array
      (
          [pages] => Array
              (
                  [-1] => Array
                      (
                          [ns] => 0
                          [title] => .MQ.Ng
                          [missing] => 
                      )
              )
      )
)

Check for this response in Scripto_Document::_getPageHistory() and return an empty array before the foreach(). Otherwise calls to the function using an uncreated page result in an "Invalid argument supplied for foreach()" warning.