From: Aryeh Gregor Date: Thu, 10 Jul 2008 18:04:32 +0000 (+0000) Subject: Fixes for r37489: X-Git-Tag: 1.31.0-rc.0~46566 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=680007475ffc5055236d85e5187b6f7b480c654f;p=lhc%2Fweb%2Fwiklou.git Fixes for r37489: * Don't pass $data or $flags by reference. They're never accessed again, so it makes no sense. * Document in hooks.txt. The interface for this hook seems very messy. It seems like it would be much cleaner to expose $data as $url (null if stored locally); and $flags as an array, or something like that. If the text is gzipped, the text can be extracted from the Revision and re-gzipped if you really want to for some strange reason. --- diff --git a/docs/hooks.txt b/docs/hooks.txt index bad937b2f4..05f43db5d6 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1011,7 +1011,13 @@ $form: the PreferencesForm $user: the User object to load preferences from 'RevisionInsertComplete': called after a revision is inserted into the DB -$revision: the Revision +&$revision: the Revision +$data: the data stored in old_text. The meaning depends on $flags: if external + is set, it's the URL of the revision text in external storage; otherwise, + it's the revision text itself. In either case, if gzip is set, the revision + text is gzipped. +$flags: a comma-delimited list of strings representing the options used. May + include: utf8 (this will always be set for new revisions); gzip; external. 'SavePreferences': called at the end of PreferencesForm::savePreferences; returning false prevents the preferences from being saved. diff --git a/includes/Revision.php b/includes/Revision.php index 09a25ec0ee..d0ccb46d75 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -773,7 +773,7 @@ class Revision { $this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId(); - wfRunHooks( 'RevisionInsertComplete', array( &$this, &$data, &$flags ) ); + wfRunHooks( 'RevisionInsertComplete', array( &$this, $data, $flags ) ); wfProfileOut( __METHOD__ ); return $this->mId;