diff options
author | Brion Vibber <brion@users.mediawiki.org> | 2005-04-26 09:52:11 +0000 |
---|---|---|
committer | Brion Vibber <brion@users.mediawiki.org> | 2005-04-26 09:52:11 +0000 |
commit | 86ae9336018ee945c302c291e7f2bca66d5fb71f (patch) | |
tree | 6a44d3ee6be7a3295ad2735292c83d2fa7b40700 /includes/Revision.php | |
parent | 8b3e9bd80c2ba3df6cdffcecdf6980b22b8ba05e (diff) | |
download | mediawikicore-86ae9336018ee945c302c291e7f2bca66d5fb71f.tar.gz mediawikicore-86ae9336018ee945c302c291e7f2bca66d5fb71f.zip |
* (bug 1982) Fix loading of old text for section merging on edits.
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/8634
Diffstat (limited to 'includes/Revision.php')
-rw-r--r-- | includes/Revision.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/Revision.php b/includes/Revision.php index 67eb4be6fcff..a42ccacbde08 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -36,6 +36,7 @@ class Revision { * @param int $id * @return Revision * @access public + * @static */ function &newFromTitle( &$title, $id = 0 ) { if( $id ) { @@ -75,6 +76,27 @@ class Revision { } /** + * Load the revision for the given title with the given timestamp. + * WARNING: Timestamps may in some circumstances not be unique, + * so this isn't the best key to use. + * + * @param Database $db + * @param Title $title + * @param string $timestamp + * @return Revision + * @access public + * @static + */ + function &loadFromTimestamp( &$db, &$title, $timestamp ) { + return Revision::loadFromConds( + $db, + array( 'rev_timestamp' => $db->timestamp( $timestamp ), + 'page_id=rev_page', + 'page_namespace' => $title->getNamespace(), + 'page_title' => $title->getDbkey() ) ); + } + + /** * Given a set of conditions, fetch a revision. * * @param array $conditions |