Replace WebRequest::getVal by ::getRawVal or ::getText

The UTF-8 normalization of getVal is not needed at all places.

Change-Id: If8fef794ff75671e32f965c7a780681d9cbd9a4a
This commit is contained in:
Fomafix 2021-11-14 16:23:26 +00:00
parent 3d8e911979
commit aec8d75570
2 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,7 @@ class CategoryTreeCategoryViewer extends CategoryViewer {
$options = $this->getConfig()->get( 'CategoryTreeCategoryPageOptions' );
$mode = $this->getRequest()->getVal( 'mode' );
$mode = $this->getRequest()->getRawVal( 'mode' );
if ( $mode !== null ) {
$options['mode'] = CategoryTree::decodeMode( $mode );
}

View file

@ -78,7 +78,7 @@ class CategoryTreePage extends SpecialPage {
if ( $par ) {
$this->target = trim( $par );
} else {
$this->target = trim( $request->getVal( 'target', '' ) );
$this->target = trim( $request->getText( 'target' ) );
if ( $this->target === '' ) {
$rootcategory = $this->msg( 'rootcategory' );
if ( $rootcategory->exists() ) {
@ -116,9 +116,9 @@ class CategoryTreePage extends SpecialPage {
* Input form for entering a category
*/
private function executeInputForm() {
$namespaces = $this->getRequest()->getVal( 'namespaces', '' );
$namespaces = $this->getRequest()->getRawVal( 'namespaces' );
// mode may be overriden by namespaces option
$mode = ( $namespaces === '' ? $this->getOption( 'mode' ) : CategoryTreeMode::ALL );
$mode = ( $namespaces === null ? $this->getOption( 'mode' ) : CategoryTreeMode::ALL );
if ( $mode === CategoryTreeMode::CATEGORIES ) {
$modeDefault = 'categories';
} elseif ( $mode === CategoryTreeMode::PAGES ) {