Fix "PHP Notice: Array to string conversion" when handling prefix/title params

$params['title'] can be an array if someone has messed with the query
parameters.

Use WebRequest::getText(), which guarantees strings (and which is
already used for 'prefix' earlier in this method).

Change-Id: I7b974067fdee22fc42c07fad98af4619fa850269
This commit is contained in:
Bartosz Dziewoński 2021-02-19 21:27:41 +01:00
parent 0ad3ed7bfc
commit 943d505e2e

View file

@ -93,11 +93,8 @@ class InputBoxHooks {
return true;
}
$title = $request->getText( 'prefix', '' ) . $request->getText( 'title', '' );
$params = $request->getValues();
$title = $params['prefix'];
if ( isset( $params['title'] ) ) {
$title .= $params['title'];
}
unset( $params['prefix'] );
$params['title'] = $title;