diff options
author | nobody <nobody@localhost> | 2006-01-05 23:36:45 +0000 |
---|---|---|
committer | nobody <nobody@localhost> | 2006-01-05 23:36:45 +0000 |
commit | 4ce70280face928c604c4300fd2ba6fdc78243da (patch) | |
tree | 3b2f616b592484fcd8bf9b70ea4a062cd5ac64fc /includes/WatchedItem.php | |
parent | 9018faf3a776fffd61bbb9a7516da6ae8bf55f55 (diff) | |
parent | b2a8013a4893454f32dc13bd253e141d7fef2f35 (diff) | |
download | mediawikicore-4ce70280face928c604c4300fd2ba6fdc78243da.tar.gz mediawikicore-4ce70280face928c604c4300fd2ba6fdc78243da.zip |
This commit was manufactured by cvs2svn to create tag 'REL1_5_5'.1.5.5
Diffstat (limited to 'includes/WatchedItem.php')
-rw-r--r-- | includes/WatchedItem.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index b27c53faf95c..1912f5400b6c 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -133,13 +133,27 @@ class WatchedItem { } /** + * Check if the given title already is watched by the user, and if so + * add watches on a new title. To be used for page renames and such. + * + * @param Title $ot Page title to duplicate entries from, if present + * @param Title $nt Page title to add watches on * @static */ function duplicateEntries( $ot, $nt ) { + WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() ); + WatchedItem::doDuplicateEntries( $ot->getTalkPage(), $nt->getTalkPage() ); + } + + /** + * @static + * @access private + */ + function doDuplicateEntries( $ot, $nt ) { $fname = "WatchedItem::duplicateEntries"; global $wgMemc, $wgDBname; - $oldnamespace = $ot->getNamespace() & ~1; - $newnamespace = $nt->getNamespace() & ~1; + $oldnamespace = $ot->getNamespace(); + $newnamespace = $nt->getNamespace(); $oldtitle = $ot->getDBkey(); $newtitle = $nt->getDBkey(); @@ -160,6 +174,11 @@ class WatchedItem { ); } $dbw->freeResult( $res ); + + if( empty( $values ) ) { + // Nothing to do + return true; + } # Perform replace # Note that multi-row replace is very efficient for MySQL but may be inefficient for |