PluginProbe
Polylang / 2.5
Polylang v2.5
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-model.php +6 -12 2.92.5 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * Links model abstract class
8 5 *
@@ -54,9 +51,9 @@
54 51 *
55 52 * @return array list of hosts
56 53 */
57 54 public function get_hosts() {
58 - return array( wp_parse_url( $this->home, PHP_URL_HOST ) );
55 + return array( parse_url( $this->home, PHP_URL_HOST ) );
59 56 }
60 57
61 58 /**
62 59 * Returns the home url
@@ -78,14 +75,11 @@
78 75 *
79 76 * @param object $language
80 77 */
81 78 protected function set_home_url( $language ) {
82 - // We should always have a default language here, except, temporarily, in PHPUnit tests. The test here protects against PHP notices.
83 - if ( isset( $this->options['default_lang'] ) ) {
84 - $search_url = $this->home_url( $language );
85 - $home_url = empty( $language->page_on_front ) || $this->options['redirect_lang'] ? $search_url : $this->front_page_url( $language );
86 - $language->set_home_url( $search_url, $home_url );
87 - }
79 + $search_url = $this->home_url( $language );
80 + $home_url = empty( $language->page_on_front ) || $this->options['redirect_lang'] ? $search_url : $this->front_page_url( $language );
81 + $language->set_home_url( $search_url, $home_url );
88 82 }
89 83
90 84 /**
91 85 * Sets the home urls and flags before the languages are persistently cached
@@ -118,10 +112,10 @@
118 112 if ( ( defined( 'PLL_CACHE_LANGUAGES' ) && ! PLL_CACHE_LANGUAGES ) || ( defined( 'PLL_CACHE_HOME_URL' ) && ! PLL_CACHE_HOME_URL ) ) {
119 113 $this->set_home_url( $language );
120 114 }
121 115
122 - // Ensures that the ( possibly cached ) home and flag urls use the right scheme http or https.
123 - $language->set_url_scheme();
116 + // Ensures that the ( possibly cached ) home url uses the right scheme http or https
117 + $language->set_home_url_scheme();
124 118 }
125 119 return $languages;
126 120 }
127 121