Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes a bug that did not recognize actions if the comment contained n…

…ew lines.
  • Loading branch information...
commit 91cd295c7194cd1a63f5ee3ec89b74e97af702f8 1 parent 3229adf
@jimsafley jimsafley authored
Showing with 4 additions and 7 deletions.
  1. +1 −1  lib/Scripto.php
  2. +3 −6 lib/Scripto/Document.php
View
2  lib/Scripto.php
@@ -653,7 +653,7 @@ public function getRevision($revisionId)
// Set the action.
$actions = array('Replaced content', 'Unprotected', 'Protected', 'Created page');
- $actionPattern = '/^(' . implode('|', $actions) . ').+$/';
+ $actionPattern = '/^(' . implode('|', $actions) . ').+$/s';
if (preg_match($actionPattern, $page['revisions'][0]['comment'])) {
$action = preg_replace($actionPattern, '$1', $page['revisions'][0]['comment']);
} else {
View
9 lib/Scripto/Document.php
@@ -823,10 +823,9 @@ protected function _getPageInfo($title)
*/
protected function _getPageHistory($title, $limit = 10, $startRevisionId = null)
{
- $actions = array('Replaced content',
- 'Unprotected',
- 'Protected',
- 'Created page');
+ $actions = array('Replaced content', 'Unprotected', 'Protected', 'Created page');
+ $actionPattern = '/^(' . implode('|', $actions) . ').+$/s';
+
$revisions = array();
do {
$response = $this->_mediawiki->getRevisions(
@@ -843,8 +842,6 @@ protected function _getPageHistory($title, $limit = 10, $startRevisionId = null)
}
foreach ($page['revisions'] as $revision) {
-
- $actionPattern = '/^(' . implode('|', $actions) . ').+$/';
if (preg_match($actionPattern, $revision['comment'])) {
$action = preg_replace($actionPattern, '$1', $revision['comment']);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.