Add more info to Title::newFromText() comment
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 10 Oct 2008 15:37:51 +0000 (15:37 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 10 Oct 2008 15:37:51 +0000 (15:37 +0000)
Point the reader to makeTitle() and makeTitleSafe() to force a namespace to be used regardless of prefix, to hopefully reduce confusion.

includes/Title.php

index cbef1ca..7f1179e 100644 (file)
@@ -100,7 +100,9 @@ class Title {
         * @param $text             string  The link text; spaces, prefixes, and an
         *   initial ':' indicating the main namespace are accepted.
         * @param $defaultNamespace int     The namespace to use if none is speci-
-        *   fied by a prefix.
+        *   fied by a prefix.  If you want to force a specific namespace even if
+        *   $text might begin with a namespace prefix, use makeTitle() or
+        *   makeTitleSafe().
         * @return Title  The new object, or null on an error.
         */
        public static function newFromText( $text, $defaultNamespace = NS_MAIN ) {