r13832 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13831‎ | r13832 | r13833 >
Date:03:29, 24 April 2006
Author:tstarling
Status:old
Tags:
Comment:
Check for invalid serialized objects and return an error condition instead of just dying.
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -530,6 +530,11 @@
531531 if( in_array( 'object', $flags ) ) {
532532 # Generic compressed storage
533533 $obj = unserialize( $text );
 534+ if ( !is_object( $obj ) ) {
 535+ // Invalid object
 536+ wfProfileOut( $fname );
 537+ return false;
 538+ }
534539 $text = $obj->getText();
535540 }
536541

Status & tagging log