From: Aaron Schulz Date: Thu, 1 May 2008 23:12:37 +0000 (+0000) Subject: Clean up username X-Git-Tag: 1.31.0-rc.0~47954 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=6ef48e840ee2e4303a578bc8371bd9a09101d8a3;p=lhc%2Fweb%2Fwiklou.git Clean up username --- diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index 8bbaeddb52..3ff2187803 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -63,7 +63,7 @@ class NewPagesForm { } elseif( is_int($t) ) { $options[$v] = $wgRequest->getInt( $v, $options[$v] ); } elseif( is_string($t) ) { - $options[$v] = $wgRequest->getText( $v, $options[$v] ); + $options[$v] = trim( $wgRequest->getVal( $v, $options[$v] ) ); } } @@ -136,6 +136,9 @@ class NewPagesForm { $hidden[] = Xml::hidden( $key, $value ); } $hidden = implode( "\n", $hidden ); + + $ut = Title::makeTitleSafe( NS_USER, $options['username'] ); + $encUser = $ut ? $ut->getText() : ''; $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . Xml::hidden( 'title', $self->getPrefixedDBkey() ) . @@ -156,7 +159,7 @@ class NewPagesForm { Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) . " " . - Xml::input( 'username', 30, $options['username'], array( 'id' => 'mw-np-username' ) ) . + Xml::input( 'username', 30, $encUser, array( 'id' => 'mw-np-username' ) ) . " " : "" ) . "