PluginProbe
Polylang / 2.6.3
Polylang v2.6.3
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/links-domain.php +2 -5 2.82.6.3 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * Links model for use when using one domain per language
8 5 * for example mysite.com/sth and mysite.fr/qqch
@@ -40,9 +37,9 @@
40 37 * @return string modified url
41 38 */
42 39 public function add_language_to_link( $url, $lang ) {
43 40 if ( ! empty( $lang ) && ! empty( $this->hosts[ $lang->slug ] ) ) {
44 - $url = preg_replace( '#://(' . wp_parse_url( $this->home, PHP_URL_HOST ) . ')($|/.*)#', '://' . $this->hosts[ $lang->slug ] . '$2', $url );
41 + $url = preg_replace( '#:\/\/(' . wp_parse_url( $this->home, PHP_URL_HOST ) . ')($|\/.*)#', '://' . $this->hosts[ $lang->slug ] . '$2', $url );
45 42 }
46 43 return $url;
47 44 }
48 45
@@ -56,9 +53,9 @@
56 53 * @return string modified url
57 54 */
58 55 public function remove_language_from_link( $url ) {
59 56 if ( ! empty( $this->hosts ) ) {
60 - $url = preg_replace( '#://(' . implode( '|', $this->hosts ) . ')($|/.*)#', '://' . wp_parse_url( $this->home, PHP_URL_HOST ) . '$2', $url );
57 + $url = preg_replace( '#:\/\/(' . implode( '|', $this->hosts ) . ')($|\/.*)#', '://' . wp_parse_url( $this->home, PHP_URL_HOST ) . '$2', $url );
61 58 }
62 59 return $url;
63 60 }
64 61