From 1c0a5b9c6ff9ad654d425e38eea8906cfbd1be09 Mon Sep 17 00:00:00 2001 From: Dreamy Jazz Date: Sat, 20 Jan 2024 11:42:16 +0000 Subject: [PATCH] Use ::getLocalUrl instead of ::getFullUrl for HideAbuseLog form Why: * The AbuseFilter Special:AbuseLog/hide page has a form that allows those with sufficent rights to hide abuse filter log entries. * This form defines a custom action, which uses a URL including the wgServer by calling ::getFullUrl. * When on WMF wikis and using mobile view, the domain name includes 'm' and as such the wgServer is not the correct URL for the form action in this case. * HTMLForm by default uses ::getLocalUrl for the action and as such Special:AbuseLog/hide should also use ::getLocalUrl to prevent these issues. What: * Change the call to ::getFullUrl in HideAbuseLog::show for the action text for the HTMLForm instance to instead be a call to ::getLocalUrl. Bug: T355012 Change-Id: I6c909d5e6724dd620cf656c9a55439ed5d5c2fb4 --- includes/View/HideAbuseLog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/View/HideAbuseLog.php b/includes/View/HideAbuseLog.php index 3ab83970f..6335e1fd7 100644 --- a/includes/View/HideAbuseLog.php +++ b/includes/View/HideAbuseLog.php @@ -113,7 +113,7 @@ class HideAbuseLog extends AbuseFilterView { ], ]; - $actionURL = $this->getTitle( 'hide' )->getFullURL( [ 'hideids' => array_fill_keys( $this->hideIDs, 1 ) ] ); + $actionURL = $this->getTitle( 'hide' )->getLocalURL( [ 'hideids' => array_fill_keys( $this->hideIDs, 1 ) ] ); HTMLForm::factory( 'ooui', $formInfo, $this->getContext() ) ->setAction( $actionURL ) ->setWrapperLegend( $this->msg( 'abusefilter-log-hide-legend' )->text() )