Page MenuHomePhabricator

diff.patch

Authored By
bzimport
Nov 21 2014, 10:13 PM
Size
1 KB
Referenced Files
None
Subscribers
None

diff.patch

Index: includes/Article.php
===================================================================
--- includes/Article.php (revision 35071)
+++ includes/Article.php (working copy)
@@ -2278,6 +2278,14 @@
$ns = $this->mTitle->getNamespace();
$t = $this->mTitle->getDBkey();
$id = $this->mTitle->getArticleID();
+ if ( $ns == NS_USER_TALK ) {
+ if ( !User::isIP( $this->mTitle->getText() ) ) {
+ $userid = User::idFromName ( $this->mTitle->getText() );
+ }
+ else {
+ $userid = $this->mTitle->getText();
+ }
+ }
if ( $t == '' || $id == 0 ) {
return false;
@@ -2333,7 +2341,17 @@
# Delete restrictions for it
$dbw->delete( 'page_restrictions', array ( 'pr_page' => $id ), __METHOD__ );
-
+
+ # Cleanup any lingering user_talk "You have new messages" flags
+ if ( $userid ) {
+ if ( !User::isIP( $userid ) ) {
+ $dbw->delete( 'user_newtalk', array ( 'user_id' => $userid ), __METHOD__ );
+ }
+ else {
+ $dbw->delete( 'user_newtalk', array ( 'user_ip' => $userid ), __METHOD__ );
+ }
+ }
+
# Fix category table counts
$cats = array();
$res = $dbw->select( 'categorylinks', 'cl_to',
@@ -2380,7 +2398,7 @@
# Clear caches
Article::onArticleDelete( $this->mTitle );
-
+
# Clear the cached article id so the interface doesn't act like we exist
$this->mTitle->resetArticleID( 0 );
$this->mTitle->mArticleID = 0;

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4518
Default Alt Text
diff.patch (1 KB)

Event Timeline