If some caller passes null for the $serialization_format parameter,
they're going to break the in-memory caching of the prepared edit even
though it's likely that the format being used is the same as the format
being used by everything else.
It seems sensible to cache null as the default format for the content
object to avoid this.
Bug: 57026
Change-Id: I4ddcf6e388636e6a6397b664b8683ad774a09a04
$user = is_null( $user ) ? $wgUser : $user;
//XXX: check $user->getId() here???
+ // Use a sane default for $serialization_format, see bug 57026
+ if ( $serialization_format === null ) {
+ $serialization_format = $content->getContentHandler()->getDefaultFormat();
+ }
+
if ( $this->mPreparedEdit
&& $this->mPreparedEdit->newContent
&& $this->mPreparedEdit->newContent->equals( $content )