Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
abstract-rules.php 0000644 00000006407 15073226631 0010224 0 ustar 00 properties = wp_parse_args( $properties, array() );
}
/**
* Returns true if this rule matches the given context.
*
* @param array $context Context.
*/
public function matches( $context ) {
$field = $this->get_property( 'field' );
if ( ! empty( $context['field'] ) ) {
if ( $field and ! in_array( $field, (array) $context['field'], true ) ) {
return false;
}
}
return true;
}
/**
* Validates with this rule's logic.
*
* @param array $context Context.
*/
public function validate( $context ) {
return true;
}
/**
* Converts the properties to an array.
*
* @return array Array of properties.
*/
public function to_array() {
$properties = (array) $this->properties;
if ( defined( 'static::rule_name' ) and static::rule_name ) {
$properties = array( 'rule' => static::rule_name ) + $properties;
}
return $properties;
}
/**
* Returns the property value specified by the given property name.
*
* @param string $name Property name.
* @return mixed Property value.
*/
public function get_property( $name ) {
if ( isset( $this->properties[$name] ) ) {
return $this->properties[$name];
}
}
/**
* Returns the default user input value from $_POST.
*
* @return mixed Default user input value.
*/
public function get_default_input() {
$field = $this->get_property( 'field' );
if ( isset( $_POST[$field] ) ) {
return wp_unslash( $_POST[$field] );
}
return '';
}
/**
* Creates an error object. Returns false if the error property is omitted.
*/
protected function create_error() {
$error_code = defined( 'static::rule_name' )
? sprintf( 'swv_%s', static::rule_name )
: 'swv';
return new WP_Error(
$error_code,
(string) $this->get_property( 'error' ),
$this
);
}
}
/**
* The base class of SWV composite rules.
*/
abstract class CompositeRule extends Rule {
protected $rules = array();
/**
* Adds a sub-rule to this composite rule.
*
* @param Rule $rule Sub-rule to be added.
*/
public function add_rule( $rule ) {
if ( $rule instanceof Rule ) {
$this->rules[] = $rule;
}
}
/**
* Returns an iterator of sub-rules.
*/
public function rules() {
foreach ( $this->rules as $rule ) {
yield $rule;
}
}
/**
* Returns true if this rule matches the given context.
*
* @param array $context Context.
*/
public function matches( $context ) {
return true;
}
/**
* Validates with this rule's logic.
*
* @param array $context Context.
*/
public function validate( $context ) {
foreach ( $this->rules() as $rule ) {
if ( $rule->matches( $context ) ) {
$result = $rule->validate( $context );
if ( is_wp_error( $result ) ) {
return $result;
}
}
}
return true;
}
/**
* Converts the properties to an array.
*
* @return array Array of properties.
*/
public function to_array() {
$rules_arrays = array_map(
static function ( $rule ) {
return $rule->to_array();
},
$this->rules
);
return array_merge(
parent::to_array(),
array(
'rules' => $rules_arrays,
)
);
}
}
rules/minlength.php 0000644 00000001442 15073226631 0010402 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return true;
}
$total = 0;
foreach ( $input as $i ) {
$total += wpcf7_count_code_units( $i );
}
$threshold = (int) $this->get_property( 'threshold' );
if ( $threshold <= $total ) {
return true;
} else {
return $this->create_error();
}
}
}
rules/file.php 0000644 00000002437 15073226631 0007341 0 ustar 00 get_property( 'field' );
$input = $_FILES[$field]['name'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
$acceptable_filetypes = array();
foreach ( (array) $this->get_property( 'accept' ) as $accept ) {
if ( preg_match( '/^\.[a-z0-9]+$/i', $accept ) ) {
$acceptable_filetypes[] = strtolower( $accept );
} else {
foreach ( wpcf7_convert_mime_to_ext( $accept ) as $ext ) {
$acceptable_filetypes[] = sprintf(
'.%s',
strtolower( trim( $ext, ' .' ) )
);
}
}
}
$acceptable_filetypes = array_unique( $acceptable_filetypes );
foreach ( $input as $i ) {
$last_period_pos = strrpos( $i, '.' );
if ( false === $last_period_pos ) { // no period
return $this->create_error();
}
$suffix = strtolower( substr( $i, $last_period_pos ) );
if ( ! in_array( $suffix, $acceptable_filetypes, true ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/enum.php 0000644 00000002132 15073226631 0007356 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$acceptable_values = (array) $this->get_property( 'accept' );
$acceptable_values = array_map(
static function ( $val ) {
$val = strval( $val );
$val = wpcf7_normalize_newline( $val );
return $val;
},
$acceptable_values
);
$acceptable_values = array_unique( $acceptable_values );
$acceptable_values = array_filter( $acceptable_values,
static function ( $val ) {
return '' !== $val;
}
);
foreach ( $input as $i ) {
$i = wpcf7_normalize_newline( $i );
if ( ! in_array( $i, $acceptable_values, true ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/maxdate.php 0000644 00000001366 15073226631 0010045 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_date( $threshold ) ) {
return true;
}
foreach ( $input as $i ) {
if ( wpcf7_is_date( $i ) and $threshold < $i ) {
return $this->create_error();
}
}
return true;
}
}
rules/minnumber.php 0000644 00000001416 15073226631 0010412 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_number( $threshold ) ) {
return true;
}
foreach ( $input as $i ) {
if ( wpcf7_is_number( $i ) and (float) $i < (float) $threshold ) {
return $this->create_error();
}
}
return true;
}
}
rules/maxitems.php 0000644 00000001321 15073226631 0010240 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_number( $threshold ) ) {
return true;
}
if ( (int) $threshold < count( $input ) ) {
return $this->create_error();
}
return true;
}
}
rules/dayofweek.php 0000644 00000002026 15073226631 0010372 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$acceptable_values = (array) $this->get_property( 'accept' );
$acceptable_values = array_map( 'intval', $acceptable_values );
$acceptable_values = array_filter( $acceptable_values );
$acceptable_values = array_unique( $acceptable_values );
foreach ( $input as $i ) {
if ( wpcf7_is_date( $i ) ) {
$datetime = date_create_immutable( $i, wp_timezone() );
$dow = (int) $datetime->format( 'N' );
if ( ! in_array( $dow, $acceptable_values, true ) ) {
return $this->create_error();
}
}
}
return true;
}
}
rules/date.php 0000644 00000001154 15073226631 0007332 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_date( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/all.php 0000644 00000001114 15073226631 0007161 0 ustar 00 rules() as $rule ) {
if ( $rule->matches( $context ) ) {
$result = $rule->validate( $context );
if ( is_wp_error( $result ) ) {
if ( $result->get_error_message() ) {
return $result;
} else {
return $this->create_error();
}
}
}
}
return true;
}
}
rules/email.php 0000644 00000001157 15073226631 0007507 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_email( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/tel.php 0000644 00000001151 15073226631 0007176 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_tel( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/stepnumber.php 0000644 00000001671 15073226631 0010605 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$base = floatval( $this->get_property( 'base' ) );
$interval = floatval( $this->get_property( 'interval' ) );
if ( ! ( 0 < $interval ) ) {
return true;
}
foreach ( $input as $i ) {
$remainder = fmod( floatval( $i ) - $base, $interval );
if (
0.0 === round( abs( $remainder ), 6 ) or
0.0 === round( abs( $remainder - $interval ), 6 )
) {
continue;
}
return $this->create_error();
}
return true;
}
}
rules/maxlength.php 0000644 00000001442 15073226631 0010404 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return true;
}
$total = 0;
foreach ( $input as $i ) {
$total += wpcf7_count_code_units( $i );
}
$threshold = (int) $this->get_property( 'threshold' );
if ( $total <= $threshold ) {
return true;
} else {
return $this->create_error();
}
}
}
rules/minfilesize.php 0000644 00000001305 15073226631 0010731 0 ustar 00 get_property( 'field' );
$input = $_FILES[$field]['size'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return true;
}
$threshold = $this->get_property( 'threshold' );
if ( array_sum( $input ) < $threshold ) {
return $this->create_error();
}
return true;
}
}
rules/any.php 0000644 00000000767 15073226631 0007215 0 ustar 00 rules() as $rule ) {
if ( $rule->matches( $context ) ) {
$result = $rule->validate( $context );
if ( ! is_wp_error( $result ) ) {
return true;
}
}
}
return $this->create_error();
}
}
rules/url.php 0000644 00000001151 15073226631 0007214 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_url( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/maxnumber.php 0000644 00000001416 15073226631 0010414 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_number( $threshold ) ) {
return true;
}
foreach ( $input as $i ) {
if ( wpcf7_is_number( $i ) and (float) $threshold < (float) $i ) {
return $this->create_error();
}
}
return true;
}
}
rules/time.php 0000644 00000001154 15073226631 0007353 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_time( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/number.php 0000644 00000001162 15073226631 0007704 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
foreach ( $input as $i ) {
if ( ! wpcf7_is_number( $i ) ) {
return $this->create_error();
}
}
return true;
}
}
rules/minitems.php 0000644 00000001321 15073226631 0010236 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_number( $threshold ) ) {
return true;
}
if ( count( $input ) < (int) $threshold ) {
return $this->create_error();
}
return true;
}
}
rules/maxfilesize.php 0000644 00000001305 15073226631 0010733 0 ustar 00 get_property( 'field' );
$input = $_FILES[$field]['size'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return true;
}
$threshold = $this->get_property( 'threshold' );
if ( $threshold < array_sum( $input ) ) {
return $this->create_error();
}
return true;
}
}
rules/required.php 0000644 00000001112 15073226631 0010227 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return $this->create_error();
}
return true;
}
}
rules/requiredfile.php 0000644 00000001126 15073226631 0011074 0 ustar 00 get_property( 'field' );
$input = $_FILES[$field]['tmp_name'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
if ( empty( $input ) ) {
return $this->create_error();
}
return true;
}
}
rules/mindate.php 0000644 00000001366 15073226631 0010043 0 ustar 00 get_default_input();
$input = wpcf7_array_flatten( $input );
$input = wpcf7_strip_whitespaces( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( ! wpcf7_is_date( $threshold ) ) {
return true;
}
foreach ( $input as $i ) {
if ( wpcf7_is_date( $i ) and $i < $threshold ) {
return $this->create_error();
}
}
return true;
}
}