Index: trunk/phase3/includes/logging/LogEntry.php |
— | — | @@ -203,13 +203,21 @@ |
204 | 204 | public function getParameters() { |
205 | 205 | if ( !isset( $this->params ) ) { |
206 | 206 | $blob = $this->getRawParameters(); |
207 | | - $params = FormatJson::decode( $blob, true /* array */ ); |
208 | | - if ( $params !== null ) { |
| 207 | + wfSuppressWarnings(); |
| 208 | + $params = unserialize( $blob ); |
| 209 | + wfRestoreWarnings(); |
| 210 | + if ( $params !== false ) { |
209 | 211 | $this->params = $params; |
210 | 212 | $this->legacy = false; |
211 | 213 | } else { |
212 | | - $this->params = explode( "\n", $blob ); |
213 | | - $this->legacy = true; |
| 214 | + $params = FormatJson::decode( $blob, true /* array */ ); |
| 215 | + if ( $params !== null ) { |
| 216 | + $this->params = $params; |
| 217 | + $this->legacy = false; |
| 218 | + } else { |
| 219 | + $this->params = explode( "\n", $blob ); |
| 220 | + $this->legacy = true; |
| 221 | + } |
214 | 222 | } |
215 | 223 | } |
216 | 224 | return $this->params; |
— | — | @@ -319,7 +327,7 @@ |
320 | 328 | } |
321 | 329 | |
322 | 330 | /** |
323 | | - * Set extra log parameters. |
| 331 | + * Set extra log parameters. |
324 | 332 | * You can pass params to the log action message |
325 | 333 | * by prefixing the keys with a number and colon. |
326 | 334 | * The numbering should start with number 4, the |
— | — | @@ -380,7 +388,7 @@ |
381 | 389 | 'log_title' => $this->getTarget()->getDBkey(), |
382 | 390 | 'log_page' => $this->getTarget()->getArticleId(), |
383 | 391 | 'log_comment' => $this->getComment(), |
384 | | - 'log_params' => FormatJson::encode( (array) $this->getParameters() ), |
| 392 | + 'log_params' => serialize( (array) $this->getParameters() ), |
385 | 393 | ); |
386 | 394 | $dbw->insert( 'logging', $data, __METHOD__ ); |
387 | 395 | $this->id = !is_null( $id ) ? $id : $dbw->insertId(); |
— | — | @@ -414,7 +422,7 @@ |
415 | 423 | $this->getSubtype(), |
416 | 424 | $this->getTarget(), |
417 | 425 | $this->getComment(), |
418 | | - FormatJson::encode( (array) $this->getParameters() ), |
| 426 | + serialize( (array) $this->getParameters() ), |
419 | 427 | $newId |
420 | 428 | ); |
421 | 429 | |