r41936 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41935‎ | r41936 | r41937 >
Date:15:37, 10 October 2008
Author:simetrical
Status:old
Tags:
Comment:
Add more info to Title::newFromText() comment

Point the reader to makeTitle() and makeTitleSafe() to force a namespace to be used regardless of prefix, to hopefully reduce confusion.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -100,7 +100,9 @@
101101 * @param $text string The link text; spaces, prefixes, and an
102102 * initial ':' indicating the main namespace are accepted.
103103 * @param $defaultNamespace int The namespace to use if none is speci-
104 - * fied by a prefix.
 104+ * fied by a prefix. If you want to force a specific namespace even if
 105+ * $text might begin with a namespace prefix, use makeTitle() or
 106+ * makeTitleSafe().
105107 * @return Title The new object, or null on an error.
106108 */
107109 public static function newFromText( $text, $defaultNamespace = NS_MAIN ) {

Status & tagging log