From: Brion Vibber Date: Mon, 28 Jul 2008 22:52:14 +0000 (+0000) Subject: Add type hint to Title::equals(); this lets the error log give us something useful... X-Git-Tag: 1.31.0-rc.0~46317 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9011bf2c3a8b2d8605a994f7c1950a183f42c23d;p=lhc%2Fweb%2Fwiklou.git Add type hint to Title::equals(); this lets the error log give us something useful like this: Catchable fatal error: Argument 1 passed to Title::equals() must be an instance of Title, null given, called in /Library/WebServer/Documents/trunk/includes/Linker.php on line 1323 and defined in /Library/WebServer/Documents/trunk/includes/Title.php on line 3003 instead of something useless like this: Fatal error: Call to a member function getInterwiki() on a non-object in /Library/WebServer/Documents/trunk/includes/Title.php on line 3005 This particular error was caused by a regression in r38149, which uses $wgTitle in Linker::doEditSectionLink(); this fails when doing parses via the API at perhaps at other times. See bug 14965 (https://bugzilla.wikimedia.org/show_bug.cgi?id=14965) --- diff --git a/includes/Title.php b/includes/Title.php index b6a59a3f09..448db9b499 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3000,7 +3000,7 @@ class Title { * @param Title $title * @return bool */ - public function equals( $title ) { + public function equals( Title $title ) { // Note: === is necessary for proper matching of number-like titles. return $this->getInterwiki() === $title->getInterwiki() && $this->getNamespace() == $title->getNamespace()