* (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off
[lhc/web/wiklou.git] / includes / Article.php
index 6e5e453..378039d 100644 (file)
@@ -2020,11 +2020,14 @@ class Article {
                                        $u = new UserTalkUpdate( 1, $this->mTitle->getNamespace(), $shortTitle, $summary,
                                          $minoredit, $timestamp_of_pagechange);
                                } else {
-                                       $other = User::newFromName($shortTitle);
-                                       if ($other) {
-                                               $other->setNewtalk(1);
-                                               $other->saveNewtalk();
+                                       $other = User::newFromName( $shortTitle );
+                                       if( is_null( $other ) && User::isIP( $shortTitle ) ) {
+                                               // An anonymous user
+                                               $other = new User();
+                                               $other->setName( $shortTitle );
                                        }
+                                       $other->setNewtalk(1);
+                                       $other->saveNewtalk();
                                }
                        }