Skip to content

Commit 79218de

Browse files
ginchauspeCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 3f8d553 commit 79218de

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wp-react-lib/src/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const buildUrlRegex = () => {
1414
if (!hosts.length) return null;
1515
const hostsPattern = hosts.map(escapeRegex).join('|');
1616
const wpRootPattern = escapeRegex(WP_ROOT);
17-
return new RegExp(`^(http|https)://(${hostsPattern})(${wpRootPattern})?`, 'ig');
17+
return new RegExp(`^(http|https)://(${hostsPattern})(?:${wpRootPattern}(?=/|$))?`, 'ig');
1818
};
1919

2020
export const replaceLink = (url, locale) => {

0 commit comments

Comments
 (0)