Externallinks: Keep domain wildcard if path is not specified

Currently, if the query is *.wikipedia.org, it still makes an exact
match to only wikipedia.org and not any of the subdomains.

Bug: T326251
Change-Id: Ib372c35220a89ad9cd4d9879f4436ed153a830c7
This commit is contained in:
Amir Sarabadani 2023-07-11 12:56:42 +02:00
parent 6a306dd6ef
commit 8059435f23

View file

@ -367,7 +367,7 @@ class LinkFilter {
array_pop( $trimmedlikeDomain );
}
$index1 = implode( '', $trimmedlikeDomain );
if ( $options['oneWildcard'] ) {
if ( $options['oneWildcard'] && $likePath[0] != '/' ) {
$domainConditions[] = 'el_to_domain_index = ' . $db->addQuotes( $index1 );
} else {
$domainConditions[] = "el_to_domain_index" . $db->buildLike( $index1, $db->anyString() );