SpecialFindComment: Allow spaces instead of underscores in the input

Our IDs and names are correctly written with underscores, but allow
spaces too for consistency with the behavior of internal wiki links
when linking to a subpage of Special:FindComment.

Change-Id: Ib9f67ac02d963395db9d56951946b9747a410a88
This commit is contained in:
Bartosz Dziewoński 2023-06-24 10:47:48 +02:00
parent 28fdcfc132
commit 80746017bb

View file

@ -78,7 +78,9 @@ class SpecialFindComment extends FormSpecialPage {
* @inheritDoc
*/
public function onSubmit( array $data ) {
$this->idOrName = $data['idorname'];
// They are correctly written with underscores, but allow spaces too for consistency with
// the behavior of internal wiki links.
$this->idOrName = str_replace( ' ', '_', $data['idorname'] );
return true;
}