403Webshell
Server IP : 145.239.37.162  /  Your IP : 216.73.216.205
Web Server : Apache
System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaa ( 38250)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/verseaa/www/wp-content/plugins/gravityforms/includes/config/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/verseaa/www/wp-content/plugins/gravityforms/includes/config//class-gf-config-data-parser.php
<?php

namespace Gravity_Forms\Gravity_Forms\Config;

/**
 * Parses a given data array to return either Live or Mock values, depending on the
 * environment and context.
 *
 * @since 2.6
 *
 * @package Gravity_Forms\Gravity_Forms\Config
 */
class GF_Config_Data_Parser {

	/**
	 * Parse the given $data array and get the correct values for the context.
	 *
	 * @since 2.6
	 *
	 * @param $data
	 *
	 * @return array
	 */
	public function parse( $data ) {
		$return = array();

		foreach( $data as $key => $value ) {
			$return[ $key ] = $this->get_correct_value( $value );
		}

		return $return;
	}

	/**
	 * Loop through each array key and get the correct value. Is called recursively for
	 * nested arrays.
	 *
	 * @since 2.6
	 *
	 * @param mixed $value
	 *
	 * @return array|mixed
	 */
	private function get_correct_value( $value ) {

		// Value isn't array - we've reached the final level for this branch.
		if ( ! is_array( $value ) ) {
			return $value;
		}

		// Value is an array with our defined value and default keys. Return either live or mock data.
		if ( array_key_exists( 'default', $value ) && array_key_exists( 'value', $value ) ) {
			return $this->is_mock() ? $value['default'] : $value['value'];
		}

		$data = array();

		// Value is an array - recursively call this method to dig into each level and return the correct value.
		foreach( $value as $key => $value ) {
			$data[ $key ] = $this->get_correct_value( $value );
		}

		return $data;
	}

	/**
	 * Determine whether the current environmental context is a Mock context.
	 *
	 * @since 2.6
	 *
	 * @return bool
	 */
	private function is_mock() {
		return defined( 'GFORMS_DOING_MOCK' ) && GFORMS_DOING_MOCK;
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit