Skip to content

Commit 836ba6f

Browse files
authored
Merge pull request #48 from justcoded/hotfix/update-autoptimize-regex
updating regex for links with a slash
2 parents ef636b6 + cf7718f commit 836ba6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/Supports/Autoptimize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function add_external_links_target_rel( $content ) {
145145
preg_match( '#http(s)?\:\/\/(([a-z0-9\_\-\.]+)\.([a-z0-9]{2,5}))\/?#', site_url(), $site_domain );
146146

147147
foreach ( $matches[0] as $tag ) {
148-
if ( preg_match( '#href="(http\:\/\/|https\:\/\/|\/\/)(([a-z0-9\_\-\.]+)\.([a-z0-9]{2,5}))"#Usmi', $tag, $domain ) ) {
148+
if ( preg_match( '#href="(http\:\/\/|https\:\/\/|\/\/)(([a-z0-9\_\-\.]+)\.([a-z0-9]{2,5}))\/#Usmi', $tag, $domain ) ) {
149149
if ( false !== strpos( $domain[2], $site_domain[2] ) ) {
150150
continue;
151151
}

0 commit comments

Comments
 (0)