Trim URL and API URLs when saving interwiki prefixes

Bug: T374771
Change-Id: Iaddf64d3297db33098dd0c56f0661e2ba81f519e
This commit is contained in:
BlankEclair 2024-09-15 12:47:19 +10:00
parent 1673b7bfa2
commit 8c6068fe2e

View file

@ -298,8 +298,10 @@ class SpecialInterwiki extends SpecialPage {
$prefix = $contLang->lc( $prefix );
// Fall through
case 'edit':
$theurl = $data['url'];
$api = $data['api'] ?? '';
// T374771: Trim the URL and API URLs to reduce confusion when
// the URLs are accidentally provided with extra whitespace
$theurl = trim( $data['url'] );
$api = trim( $data['api'] ?? '' );
$local = $data['local'] ? 1 : 0;
$trans = $data['trans'] ? 1 : 0;
$rows = [