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
This commit is contained in:
Alex Monk 2015-03-21 23:13:02 +00:00
parent fa5d22f23c
commit f5c4a724dc

View file

@ -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:' ) );