Log callers that trigger Title::newFromText $text type warning
[lhc/web/wiklou.git] / includes / Title.php
index fe989b5..601211d 100644 (file)
@@ -265,6 +265,7 @@ class Title {
                if ( is_object( $text ) ) {
                        throw new InvalidArgumentException( '$text must be a string.' );
                } elseif ( !is_string( $text ) ) {
+                       wfDebugLog( 'T76305', wfGetAllCallers( 5 ) );
                        wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.', 2 );
                }
 
@@ -4235,10 +4236,12 @@ class Title {
         * If you want to know if a title can be meaningfully viewed, you should
         * probably call the isKnown() method instead.
         *
+        * @param int $flags An optional bit field; may be Title::GAID_FOR_UPDATE to check
+        *   from master/for update
         * @return bool
         */
-       public function exists() {
-               $exists = $this->getArticleID() != 0;
+       public function exists( $flags = 0 ) {
+               $exists = $this->getArticleID( $flags ) != 0;
                Hooks::run( 'TitleExists', array( $this, &$exists ) );
                return $exists;
        }