Some paranoia checks
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 3 Oct 2004 07:06:18 +0000 (07:06 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 3 Oct 2004 07:06:18 +0000 (07:06 +0000)
includes/Title.php

index 36e34c8..f7e7574 100644 (file)
@@ -188,7 +188,7 @@ class Title {
                $t =& new Title();
                $t->mInterwiki = '';
                $t->mFragment = '';
-               $t->mNamespace = $ns;
+               $t->mNamespace = IntVal( $ns );
                $t->mDbkeyform = $title;
                $t->mArticleID = ( $ns >= 0 ) ? -1 : 0;
                $t->mUrlform = wfUrlencode( $title );
@@ -478,7 +478,7 @@ class Title {
         * @param int $n the namespace index, one of the NS_xxxx constants
         * @access public
         */
-       function setNamespace( $n ) { $this->mNamespace = $n; }
+       function setNamespace( $n ) { $this->mNamespace = IntVal( $n; ) }
        /**
         * Get the interwiki prefix (or null string)
         * @return string