(bug 15646) Page creation notification email is sent when a watched page is deleted
[lhc/web/wiklou.git] / includes / RecentChange.php
index 50b949c..e3b8162 100644 (file)
@@ -119,6 +119,8 @@ class RecentChange
        public function &getTitle() {
                if( $this->mTitle === false ) {
                        $this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
+                       # Make sure the correct page ID is process cached
+                       $this->mTitle->resetArticleID( $this->mAttribs['rc_cur_id'] );
                }
                return $this->mTitle;
        }
@@ -158,7 +160,7 @@ class RecentChange
 
                ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
                if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) {
-                       unset ( $this->mAttribs['rc_cur_id'] );
+                       unset( $this->mAttribs['rc_cur_id'] );
                }
 
                # Insert new row
@@ -194,7 +196,8 @@ class RecentChange
                                $this->mAttribs['rc_timestamp'],
                                $this->mAttribs['rc_comment'],
                                $this->mAttribs['rc_minor'],
-                               $this->mAttribs['rc_last_oldid'] );
+                               $this->mAttribs['rc_last_oldid'],
+                               $this->mAttribs['rc_deleted'] );
                }
        }
        
@@ -235,12 +238,12 @@ class RecentChange
        }
        
        /**
-        * Remove newlines and carriage returns
+        * Remove newlines, carriage returns and decode html entites
         * @param string $line
         * @return string
         */
        public static function cleanupForIRC( $text ) {
-               return str_replace(array("\n", "\r"), array("", ""), $text);
+               return Sanitizer::decodeCharReferences( str_replace( array( "\n", "\r" ), array( "", "" ), $text ) );
        }
 
        /**