removed an apparently complicated way to trim whitespace off, also threw php notices
authorGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 8 Apr 2004 21:08:03 +0000 (21:08 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 8 Apr 2004 21:08:03 +0000 (21:08 +0000)
includes/Title.php

index 94ef83e..365378e 100644 (file)
@@ -601,14 +601,7 @@ class Title {
 
                # Clean up whitespace
                #
-               $t = preg_replace( "/[\\s_]+/", "_", $this->mDbkeyform );
-               if ( "_" == @$t{0} ) { 
-                       $t = substr( $t, 1 ); 
-               }
-               $l = strlen( $t );
-               if ( $l && ( "_" == $t{$l-1} ) ) { 
-                       $t = substr( $t, 0, $l-1 ); 
-               }
+               $t = preg_replace( "/[\\s_]+/", "_", trim($this->mDbkeyform) );
                if ( "" == $t ) {
                        wfProfileOut( $fname );
                        return false;