The regex /?$ will add a second slash to URLs which already end
in a slash (since it will match both the trailing slash and the
empty position after it), which is enough to trip up HyperSwitch.
Change-Id: I675f8252a2496ace4d6c364a869776dff604df59
'fixedUrl' => false,
], $params );
// Ensure that the url parameter has a trailing slash.
- $mparams['url'] = preg_replace(
- '#/?$#',
- '/',
- $mparams['url']
- );
+ if ( substr( $mparams['url'], -1 ) !== '/' ) {
+ $mparams['url'] .= '/';
+ }
// Ensure the correct domain format: strip protocol, port,
// and trailing slash if present. This lets us use
// $wgCanonicalServer as a default value, which is very convenient.