From 99e3a646ba2ac2cf0bd55bd572aa549ac9481320 Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Mon, 1 Apr 2019 10:42:57 -0400 Subject: [PATCH] LogFormatter: ignore unrecoverable data It is possible for the log_params column of the logging table to contain serialized data that cannot be deserialized anymore because the types it references are missing. It is currently the case with old Flow log entries on enwiki. The extension is uninstalled and the UUID class is not found. This patch proposes to simply skip the params and log a warning in that case. Bug: T212742 Change-Id: I3226b8fb338dd2b81e087af5d798d8f35368282d --- includes/logging/LogFormatter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 1f37a35e18..b9bb70c321 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -817,6 +817,11 @@ class LogFormatter { foreach ( $this->getParametersForApi() as $key => $value ) { $vals = explode( ':', $key, 3 ); if ( count( $vals ) !== 3 ) { + if ( $value instanceof __PHP_Incomplete_Class ) { + wfLogWarning( 'Log entry of type ' . $this->entry->getFullType() . + ' contains unrecoverable extra parameters.' ); + continue; + } $logParams[$key] = $value; continue; } -- 2.20.1