mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 23:40:19 +00:00
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:
parent
fa5d22f23c
commit
f5c4a724dc
|
@ -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:' ) );
|
||||
|
|
Loading…
Reference in a new issue