Ticket #3109: 3109-banner-link.diff
File 3109-banner-link.diff, 1.4 KB (added by , 3 years ago) |
---|
-
api/routes/class-locale-banner.php
86 86 if ( 'en_US' === $current_locale ) { 87 87 $current_site = get_site(); 88 88 89 $referring_path = wp_parse_url( $request->get_header( 'referer' ), PHP_URL_PATH ); 90 if ( $referring_path && '/' === $referring_path[0] ) 91 $current_path = $referring_path; 92 else 93 $current_path = $current_site->path; 94 89 95 // Only one locale suggestion. 90 96 if ( 1 === count( $suggest_named_locales ) ) { 91 97 $locale = key( $suggest_named_locales ); … … 109 115 sprintf( 110 116 '<a href="https://%s.wordpress.org%s">%s</a>', 111 117 $locale_subdomain_assoc[ $locale ]->subdomain, 112 $current_site->path,118 esc_url( $current_path ), 113 119 $language 114 120 ) 115 121 ); … … 151 157 $other_suggest .= sprintf( 152 158 '<a href="https://%s.wordpress.org%s">%s</a>, ', 153 159 $locale_subdomain_assoc[ $locale ]->subdomain, 154 $ current_site->path,160 $esc_url( $current_path ), 155 161 $language 156 162 ); 157 163 } … … 161 167 sprintf( 162 168 '<a href="https://%s.wordpress.org%s">%s</a>', 163 169 $locale_subdomain_assoc[ $primary_locale ]->subdomain, 164 $ current_site->path,170 $esc_url( $current_path ), 165 171 $primary_language 166 172 ), 167 173 trim( $other_suggest, ' ,' )