From f5c4a724dcaa5fdd1d7283598c5a8cd92185b157 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sat, 21 Mar 2015 23:13:02 +0000 Subject: [PATCH] Fix for legacy testwiki AFL entries (1 to 154) Also clean up an easy-for-users-to-break check for these legacy entries Tested on mw1017 Change-Id: I7c1a45e39f188f4509fe4a601d2fd524717c00f8 --- AbuseFilter.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 70d20d6bc..3108c5760 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -1143,8 +1143,17 @@ class AbuseFilter { */ public static function loadVarDump( $stored_dump ) { // Back-compat - if ( strpos( $stored_dump, 'stored-text:' ) === false ) { - return unserialize( $stored_dump ); + if ( substr( $stored_dump, 0, strlen( 'stored-text:' ) ) !== 'stored-text:' ) { + $data = unserialize( $stored_dump ); + if ( is_array( $data ) ) { + $vh = new AbuseFilterVariableHolder; + foreach ( $data as $name => $value ) { + $vh->setVar( $name, $value ); + } + return $vh; + } else { + return $data; + } } $text_id = substr( $stored_dump, strlen( 'stored-text:' ) );