Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3127,3 +3127,17 @@ |
3128 | 3128 | |
3129 | 3129 | return $output; |
3130 | 3130 | } |
| 3131 | + |
| 3132 | +/* Recursively converts the parameter (an object) to an array with the same data */ |
| 3133 | +function wfObjectToArray( $object, $recursive = true ) { |
| 3134 | + $array = array(); |
| 3135 | + foreach ( get_object_vars($object) as $key => $value ) { |
| 3136 | + if ( is_object($value) && $recursive ) { |
| 3137 | + $value = wfObjectToArray( $value ); |
| 3138 | + } |
| 3139 | + |
| 3140 | + $array[$key] = $value; |
| 3141 | + } |
| 3142 | + |
| 3143 | + return $array; |
| 3144 | +} |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php |
— | — | @@ -368,7 +368,7 @@ |
369 | 369 | } |
370 | 370 | |
371 | 371 | // Add export |
372 | | - $exportText = serialize( array( 'row' => $row, 'actions' => $actions ) ); |
| 372 | + $exportText = json_encode( array( 'row' => $row, 'actions' => $actions ) ); |
373 | 373 | $tools .= Xml::tags( 'a', array( 'href' => 'javascript:afShowExport();' ), |
374 | 374 | wfMsgExt( 'abusefilter-edit-export', 'parseinline' ) ); |
375 | 375 | $tools .= Xml::element( 'textarea', |
— | — | @@ -676,10 +676,10 @@ |
677 | 677 | // Check for importing |
678 | 678 | $import = $wgRequest->getVal( 'wpImportText' ); |
679 | 679 | if ($import) { |
680 | | - $data = unserialize($import); |
| 680 | + $data = json_decode($import); |
681 | 681 | |
682 | | - $importRow = $data['row']; |
683 | | - $actions = $data['actions']; |
| 682 | + $importRow = $data->row; |
| 683 | + $actions = wfObjectToArray( $data->actions ); |
684 | 684 | |
685 | 685 | $copy = array( |
686 | 686 | 'af_public_comments', |