As the sun rises and the forest mist clears, and the clouds return and the caves darken, these changes of light and shadow are the morning and evening in the mountains. Wildflowers bloom with their subtle fragrance, fine trees flourish with their dense shade, the wind and frost are pure and clean, and the water recedes to reveal the rocks—these are the four seasons in the mountains. Going out in the morning and returning in the evening, the scenery of the four seasons is different, and the joy is endless.至于负者歌于途,行者休于树,前者呼,后者应,伛偻提携,往来而不绝者,滁人游也。临溪而渔,溪深而鱼肥,酿泉为酒,泉香而酒洌,山肴野蔌,杂然而前陈者,太守宴也。宴酣之乐,非丝非竹,射者中,弈者胜,觥筹交错,起坐而喧哗者,众宾欢也。苍颜白发,颓然乎其间者,太守醉也。 HEX
HEX
Server: Apache
System: Linux webd003.cluster106.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: labeautef (51223)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/labeautef/labeautedegaby.com/wp-content/plugins/polylang/src/links-abstract-domain.php
<?php
/**
 * @package Polylang
 */

/**
 * Links model for use when using one domain or subdomain per language.
 *
 * @since 2.0
 */
abstract class PLL_Links_Abstract_Domain extends PLL_Links_Permalinks {

	/**
	 * Constructor.
	 *
	 * @since 2.0
	 *
	 * @param PLL_Model $model Instance of PLL_Model.
	 */
	public function __construct( &$model ) {
		parent::__construct( $model );

		// Avoid cross domain requests (mainly for custom fonts).
		add_filter( 'content_url', array( $this, 'site_url' ) );
		add_filter( 'theme_root_uri', array( $this, 'site_url' ) ); // The above filter is not sufficient with WPMU Domain Mapping.
		add_filter( 'plugins_url', array( $this, 'site_url' ) );
		add_filter( 'rest_url', array( $this, 'site_url' ) );
		add_filter( 'upload_dir', array( $this, 'upload_dir' ) );

		// Set the correct domain for each language.
		add_filter( 'pll_language_flag_url', array( $this, 'site_url' ) );
	}

	/**
	 * Returns the language based on the language code in url.
	 *
	 * @since 1.2
	 * @since 2.0 Add the $url argument.
	 *
	 * @param string $url Optional, defaults to the current url.
	 * @return string Language slug.
	 */
	public function get_language_from_url( $url = '' ) {
		if ( empty( $url ) ) {
			$url = pll_get_requested_url();
		}

		$host = wp_parse_url( $url, PHP_URL_HOST );
		$lang = array_search( $host, $this->get_hosts() );

		return is_string( $lang ) ? $lang : '';
	}

	/**
	 * Modifies an url to use the domain associated to the current language.
	 *
	 * @since 1.8
	 *
	 * @param string $url The url to modify.
	 * @return string The modified url.
	 */
	public function site_url( $url ) {
		$lang = $this->get_language_from_url();

		$lang = $this->model->get_language( $lang );

		return $this->add_language_to_link( $url, $lang );
	}

	/**
	 * Fixes the domain for the upload directory.
	 *
	 * @since 2.0.6
	 *
	 * @param array $uploads Array of information about the upload directory. @see wp_upload_dir().
	 * @return array
	 */
	public function upload_dir( $uploads ) {
		$lang = $this->get_language_from_url();
		$lang = $this->model->get_language( $lang );
		$uploads['url'] = $this->add_language_to_link( $uploads['url'], $lang );
		$uploads['baseurl'] = $this->add_language_to_link( $uploads['baseurl'], $lang );
		return $uploads;
	}

	/**
	 * Adds home and search URLs to language data before the object is created.
	 *
	 * @since 3.4.1
	 *
	 * @param array $additional_data Array of language additional data.
	 * @param array $language        Language data.
	 * @return array Language data with home and search URLs added.
	 */
	public function set_language_home_urls( $additional_data, $language ) {
		$language = array_merge( $language, $additional_data );
		$additional_data['search_url'] = $this->home_url( $language['slug'] );
		$additional_data['home_url']   = $additional_data['search_url'];
		return $additional_data;
	}

	/**
	 * Returns language home URL property according to the current domain.
	 *
	 * @since 3.4.4
	 *
	 * @param string $url      Home URL.
	 * @param array  $language Array of language props.
	 * @return string Filtered home URL.
	 */
	public function set_language_home_url( $url, $language ) {
		return $this->home_url( $language['slug'] );
	}
}