public function isLegacy() {
return false;
}
+
+ /**
+ * Create a blob from a parameter array
+ *
+ * @param array $params
+ * @return string
+ * @since 1.26
+ */
+ public static function makeParamBlob( $params ) {
+ return serialize( (array)$params );
+ }
+
+ /**
+ * Extract a parameter array from a blob
+ *
+ * @param string $blob
+ * @return array
+ * @since 1.26
+ */
+ public static function extractParams( $blob ) {
+ return unserialize( $blob );
+ }
}
/**
if ( !isset( $this->params ) ) {
$blob = $this->getRawParameters();
wfSuppressWarnings();
- $params = unserialize( $blob );
+ $params = LogEntryBase::extractParams( $blob );
wfRestoreWarnings();
if ( $params !== false ) {
$this->params = $params;
$this->legacy = false;
} else {
- $this->params = $blob === '' ? array() : explode( "\n", $blob );
+ $this->params = LogPage::extractParams( $blob );
$this->legacy = true;
}
}
'log_title' => $this->getTarget()->getDBkey(),
'log_page' => $this->getTarget()->getArticleID(),
'log_comment' => $comment,
- 'log_params' => serialize( (array)$this->getParameters() ),
+ 'log_params' => LogEntryBase::makeParamBlob( $this->getParameters() ),
);
if ( isset( $this->deleted ) ) {
$data['log_deleted'] = $this->deleted;
$this->getSubtype(),
$this->getTarget(),
$this->getComment(),
- serialize( (array)$this->getParameters() ),
+ LogEntryBase::makeParamBlob( $this->getParameters() ),
$newId,
$formatter->getIRCActionComment() // Used for IRC feeds
);