First little bit of cleaning out the Augean stables of SpecialBlockip.php: spin out...
[lhc/web/wiklou.git] / includes / Title.php
index be0dbd1..a992bc9 100644 (file)
@@ -990,8 +990,9 @@ class Title {
         * @return String the URL
         */
        public function getInternalURL( $query = '', $variant = false ) {
-               global $wgInternalServer;
-               $url = $wgInternalServer . $this->getLocalURL( $query, $variant );
+               global $wgInternalServer, $wgServer;
+               $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
+               $url = $server . $this->getLocalURL( $query, $variant );
                wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
                return $url;
        }
@@ -4136,6 +4137,10 @@ class Title {
         * @return array applicable restriction types
         */
        public function getRestrictionTypes() {
+               if ( $this->getNamespace() == NS_SPECIAL ) {
+                       return array();
+               }
+
                $types = self::getFilteredRestrictionTypes( $this->exists() );
 
                if ( $this->getNamespace() != NS_FILE ) {
@@ -4162,7 +4167,7 @@ class Title {
                $types = $wgRestrictionTypes;
                if ( $exists ) {
                        # Remove the create restriction for existing titles
-                       $types = array_diff( $types, array( 'create' ) );                       
+                       $types = array_diff( $types, array( 'create' ) );
                } else {
                        # Only the create and upload restrictions apply to non-existing titles
                        $types = array_intersect( $types, array( 'create', 'upload' ) );