Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/69978


Change subject: Fix unserialization of revision data
......................................................................

Fix unserialization of revision data

bug 49971

Change-Id: Id719b27e9fb83be0d54a211b7006189b9444c2a0
---
M includes/rows/EPRevision.php
M includes/tables/Revisions.php
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/78/69978/1

diff --git a/includes/rows/EPRevision.php b/includes/rows/EPRevision.php
index 3d69c36..6190922 100644
--- a/includes/rows/EPRevision.php
+++ b/includes/rows/EPRevision.php
@@ -47,7 +47,14 @@
 
                $tableClass = $map[$tableClass];
 
-               return $tableClass::singleton()->newRow( $this->getField( 
'data' ), true );
+               $data = $this->getField( 'data' );
+
+               // Workaround for bug 49971
+               if ( is_string( $data ) ) {
+                       $data = unserialize( $data );
+               }
+
+               return $tableClass::singleton()->newRow( $data, true );
        }
 
        /**
diff --git a/includes/tables/Revisions.php b/includes/tables/Revisions.php
index 8fc5fee..cccbef5 100644
--- a/includes/tables/Revisions.php
+++ b/includes/tables/Revisions.php
@@ -82,7 +82,7 @@
                        'minor_edit' => $revAction->isMinor(),
                        'time' => $revAction->getTime(),
                        'deleted' => $revAction->isDelete(),
-                       'data' => serialize( $object->toArray() )
+                       'data' => $object->toArray()
                ) );
 
                $identifier = $object->getIdentifier();

-- 
To view, visit https://gerrit.wikimedia.org/r/69978
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id719b27e9fb83be0d54a211b7006189b9444c2a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to