From: Stephane Bisson Date: Mon, 1 Apr 2019 14:42:57 +0000 (-0400) Subject: LogFormatter: ignore unrecoverable data X-Git-Tag: 1.34.0-rc.0~2179^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=99e3a646ba2ac2cf0bd55bd572aa549ac9481320;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; }