From: Gabriel Wicke Date: Thu, 8 Apr 2004 21:08:03 +0000 (+0000) Subject: removed an apparently complicated way to trim whitespace off, also threw php notices X-Git-Tag: 1.3.0beta1~550 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=8fda3fc1a32e510ab04d47c0a7ea8a8217fd7246;p=lhc%2Fweb%2Fwiklou.git removed an apparently complicated way to trim whitespace off, also threw php notices --- diff --git a/includes/Title.php b/includes/Title.php index 94ef83ebc7..365378e529 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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;