| Current Path : /proc/1908984/root/proc/1908984/root/home/digilove/www/41423/ |
| Current File : //proc/1908984/root/proc/1908984/root/home/digilove/www/41423/Input.php.tar |
home/digilove/public_html/110/libraries/src/Input/Input.php 0000644 00000014007 15235156053 0017562 0 ustar 00 <?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Input;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Filter\InputFilter;
/**
* Joomla! Input Base Class
*
* This is an abstracted input class used to manage retrieving data from the application environment.
*
* @since 1.7.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*
* @property-read Input $get
* @property-read Input $post
* @property-read Input $request
* @property-read Input $server
* @property-read Input $env
* @property-read Files $files
* @property-read Cookie $cookie
*/
class Input extends \Joomla\Input\Input
{
/**
* Container with allowed superglobals
*
* @var array
* @since 3.8.9
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
private static $allowedGlobals = array('REQUEST', 'GET', 'POST', 'FILES', 'SERVER', 'ENV');
/**
* Input objects
*
* @var Input[]
* @since 1.7.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
protected $inputs = array();
/**
* Constructor.
*
* @param array $source Source data (Optional, default is $_REQUEST)
* @param array $options Array of configuration parameters (Optional)
*
* @since 1.7.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
public function __construct($source = null, array $options = array())
{
if (!isset($options['filter']))
{
$this->filter = InputFilter::getInstance();
}
parent::__construct($source, $options);
}
/**
* Magic method to get an input object
*
* @param mixed $name Name of the input object to retrieve.
*
* @return Input The request input object
*
* @since 1.7.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
public function __get($name)
{
if (isset($this->inputs[$name]))
{
return $this->inputs[$name];
}
$className = '\\Joomla\\CMS\\Input\\' . ucfirst($name);
if (class_exists($className))
{
$this->inputs[$name] = new $className(null, $this->options);
return $this->inputs[$name];
}
$superGlobal = '_' . strtoupper($name);
if (in_array(strtoupper($name), self::$allowedGlobals, true) && isset($GLOBALS[$superGlobal]))
{
$this->inputs[$name] = new Input($GLOBALS[$superGlobal], $this->options);
return $this->inputs[$name];
}
// Try using the parent class
return parent::__get($name);
}
/**
* Gets an array of values from the request.
*
* @param array $vars Associative array of keys and filter types to apply.
* If empty and datasource is null, all the input data will be returned
* but filtered using the filter given by the parameter defaultFilter in
* JFilterInput::clean.
* @param mixed $datasource Array to retrieve data from, or null.
* @param string $defaultFilter Default filter used in JFilterInput::clean if vars is empty and
* datasource is null. If 'unknown', the default case is used in
* JFilterInput::clean.
*
* @return mixed The filtered input data.
*
* @since 1.7.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
public function getArray(array $vars = array(), $datasource = null, $defaultFilter = 'unknown')
{
return $this->getArrayRecursive($vars, $datasource, $defaultFilter, false);
}
/**
* Gets an array of values from the request.
*
* @param array $vars Associative array of keys and filter types to apply.
* If empty and datasource is null, all the input data will be returned
* but filtered using the filter given by the parameter defaultFilter in
* JFilterInput::clean.
* @param mixed $datasource Array to retrieve data from, or null.
* @param string $defaultFilter Default filter used in JFilterInput::clean if vars is empty and
* datasource is null. If 'unknown', the default case is used in
* JFilterInput::clean.
* @param bool $recursion Flag to indicate a recursive function call.
*
* @return mixed The filtered input data.
*
* @since 3.4.2
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
protected function getArrayRecursive(array $vars = array(), $datasource = null, $defaultFilter = 'unknown', $recursion = false)
{
if (empty($vars) && is_null($datasource))
{
$vars = $this->data;
}
else
{
if (!$recursion)
{
$defaultFilter = null;
}
}
$results = array();
foreach ($vars as $k => $v)
{
if (is_array($v))
{
if (is_null($datasource))
{
$results[$k] = $this->getArrayRecursive($v, $this->get($k, null, 'array'), $defaultFilter, true);
}
else
{
$results[$k] = $this->getArrayRecursive($v, $datasource[$k], $defaultFilter, true);
}
}
else
{
$filter = isset($defaultFilter) ? $defaultFilter : $v;
if (is_null($datasource))
{
$results[$k] = $this->get($k, null, $filter);
}
elseif (isset($datasource[$k]))
{
$results[$k] = $this->filter->clean($datasource[$k], $filter);
}
else
{
$results[$k] = $this->filter->clean(null, $filter);
}
}
}
return $results;
}
/**
* Method to unserialize the input.
*
* @param string $input The serialized input.
*
* @return Input The input object.
*
* @since 3.0.0
* @deprecated 5.0 Use Joomla\Input\Input instead
*/
public function unserialize($input)
{
// Unserialize the options, data, and inputs.
list($this->options, $this->data, $this->inputs) = unserialize($input);
// Load the filter.
if (isset($this->options['filter']))
{
$this->filter = $this->options['filter'];
}
else
{
$this->filter = InputFilter::getInstance();
}
}
}
home/digilove/public_html/libraries/fof30/Input/Input.php 0000644 00000011073 15235577610 0017415 0 ustar 00 <?php
/**
* @package FOF
* @copyright Copyright (c)2010-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 2 or later
*/
namespace FOF30\Input;
defined('_JEXEC') or die;
class Input extends \JInput
{
/**
* Public constructor. Overridden to allow specifying the global input array
* to use as a string and instantiate from an object holding variables.
*
* @param array|string|object|null $source Source data; set null to use $_REQUEST
* @param array $options Filter options
*/
public function __construct($source = null, array $options = array())
{
$hash = null;
if (is_string($source))
{
$hash = strtoupper($source);
switch ($hash)
{
case 'GET':
$source = $_GET;
break;
case 'POST':
$source = $_POST;
break;
case 'FILES':
$source = $_FILES;
break;
case 'COOKIE':
$source = $_COOKIE;
break;
case 'ENV':
$source = $_ENV;
break;
case 'SERVER':
$source = $_SERVER;
break;
default:
$source = $_REQUEST;
$hash = 'REQUEST';
break;
}
}
elseif (is_object($source) && ($source instanceof Input))
{
$source = $source->getData();
}
elseif (is_object($source) && ($source instanceof \JInput))
{
$serialised = $source->serialize();
list ($xOptions, $xData, $xInput) = unserialize($serialised);
unset ($xOptions);
unset ($xInput);
unset ($source);
$source = $xData;
unset ($xData);
}
elseif (is_object($source))
{
try
{
$source = (array) $source;
}
catch (\Exception $exc)
{
$source = null;
}
}
elseif (is_array($source))
{
// Nothing, it's already an array
}
else
{
// Any other case
$source = null;
}
// If we are not sure use the REQUEST array
if (empty($source))
{
$source = $_REQUEST;
$hash = 'REQUEST';
}
// Magic quotes GPC handling (something JInput simply can't handle at all)
// @codeCoverageIgnoreStart
if (($hash == 'REQUEST') && get_magic_quotes_gpc() && class_exists('\\JRequest', true))
{
$source = \JRequest::get('REQUEST', 2);
}
// @codeCoverageIgnoreEnd
parent::__construct($source, $options);
}
/**
* Gets a value from the input data. Overridden to allow specifying a filter
* mask.
*
* @param string $name Name of the value to get.
* @param mixed $default Default value to return if variable does not exist.
* @param string $filter Filter to apply to the value.
* @param int $mask The filter mask
*
* @return mixed The filtered input value.
*/
public function get($name, $default = null, $filter = 'cmd', $mask = 0)
{
if (isset($this->data[$name]))
{
return $this->_cleanVar($this->data[$name], $mask, $filter);
}
return $default;
}
/**
* Returns a copy of the raw data stored in the class
*
* @return array
*/
public function getData()
{
return $this->data;
}
/**
* Magic method to get filtered input data.
*
* @param mixed $name Name of the value to get.
* @param string $arguments [0] The name of the variable [1] The default value [2] Mask
*
* @return boolean The filtered boolean input value.
*/
public function __call($name, $arguments)
{
if (substr($name, 0, 3) == 'get')
{
$filter = substr($name, 3);
$default = null;
$mask = 0;
if (isset($arguments[1]))
{
$default = $arguments[1];
}
if (isset($arguments[2]))
{
$mask = $arguments[2];
}
return $this->get($arguments[0], $default, $filter, $mask);
}
}
/**
* Custom filter implementation. Works better with arrays and allows the use
* of a filter mask.
*
* @param mixed $var The variable (value) to clean
* @param integer $mask The clean mask
* @param string $type The variable type
*
* @return mixed
*/
protected function _cleanVar($var, $mask = 0, $type = null)
{
if (is_array($var))
{
$temp = array();
foreach ($var as $k => $v)
{
$temp[$k] = self::_cleanVar($v, $mask);
}
return $temp;
}
// If the no trim flag is not set, trim the variable
if (!($mask & 1) && is_string($var))
{
$var = trim($var);
}
// Now we handle input filtering
if ($mask & 2)
{
// If the allow raw flag is set, do not modify the variable
}
elseif ($mask & 4)
{
// If the allow HTML flag is set, apply a safe HTML filter to the variable
$safeHtmlFilter = \JFilterInput::getInstance(null, null, 1, 1);
$var = $safeHtmlFilter->clean($var, $type);
}
else
{
$var = $this->filter->clean($var, $type);
}
return $var;
}
}
home/digilove/public_html/110/libraries/fof40/Input/Input.php 0000644 00000013161 15236061027 0017706 0 ustar 00 <?php
/**
* @package FOF
* @copyright Copyright (c)2010-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
namespace FOF40\Input;
defined('_JEXEC') || die;
use Exception;
use JFilterInput;
use Joomla\CMS\Factory;
use Joomla\CMS\Filter\InputFilter;
use Joomla\Input\Input as JoomlaInput;
use ReflectionObject;
class Input extends JoomlaInput
{
/**
* Public constructor. Overridden to allow specifying the global input array
* to use as a string and instantiate from an object holding variables.
*
* @param array|string|object|null $source Source data; set null to use $_REQUEST
* @param array $options Filter options
*/
public function __construct($source = null, array $options = [])
{
$hash = null;
if (is_string($source))
{
$hash = strtoupper($source);
if (!in_array($hash, ['GET', 'POST', 'FILES', 'COOKIE', 'ENV', 'SERVER', 'REQUEST']))
{
$hash = 'REQUEST';
}
$source = $this->extractJoomlaSource($hash);
}
elseif (is_object($source) && ($source instanceof Input))
{
$source = $source->getData();
}
elseif (is_object($source) && ($source instanceof JoomlaInput))
{
$serialised = $source->serialize();
[$xOptions, $xData, $xInput] = unserialize($serialised);
unset ($xOptions);
unset ($xInput);
unset ($source);
$source = $xData;
unset ($xData);
}
elseif (is_object($source))
{
try
{
$source = (array) $source;
}
catch (Exception $exc)
{
$source = null;
}
}
/** @noinspection PhpStatementHasEmptyBodyInspection */
elseif (is_array($source))
{
// Nothing, it's already an array
}
else
{
// Any other case
$source = null;
}
// TODO Joomla 4 -- get the data from the application input
// If we are not sure use the REQUEST array
if (empty($source))
{
$source = $this->extractJoomlaSource();
}
parent::__construct($source, $options);
}
/**
* Gets a value from the input data. Overridden to allow specifying a filter
* mask.
*
* @param string $name Name of the value to get.
* @param mixed $default Default value to return if variable does not exist.
* @param string $filter Filter to apply to the value.
* @param int $mask The filter mask
*
* @return mixed The filtered input value.
*/
public function get($name, $default = null, $filter = 'cmd', $mask = 0)
{
if (isset($this->data[$name]))
{
return $this->_cleanVar($this->data[$name], $mask, $filter);
}
return $default;
}
/**
* Remove a key from the input data.
*
* @param string $name The key name to remove from the input data.
*
* @return void
* @since 3.6.3
*/
public function remove($name)
{
if (!isset($this->data[$name]))
{
return;
}
unset($this->data[$name]);
}
/**
* Returns a copy of the raw data stored in the class
*
* @return array
*/
public function getData(): array
{
return $this->data;
}
/**
* Override all the raw data stored in the class. USE SPARINGLY.
*
* @param array $data
*/
public function setData(array $data): void
{
$this->data = $data;
}
/**
* Magic method to get filtered input data.
*
* @param mixed $name Name of the value to get.
* @param string $arguments [0] The name of the variable [1] The default value [2] Mask
*
* @return boolean The filtered boolean input value.
*/
public function __call($name, $arguments)
{
if (substr($name, 0, 3) == 'get')
{
$filter = substr($name, 3);
$default = null;
$mask = 0;
if (isset($arguments[1]))
{
$default = $arguments[1];
}
if (isset($arguments[2]))
{
$mask = $arguments[2];
}
return $this->get($arguments[0], $default, $filter, $mask);
}
}
/**
* Custom filter implementation. Works better with arrays and allows the use
* of a filter mask.
*
* @param mixed $var The variable (value) to clean
* @param integer $mask The clean mask
* @param string $type The variable type
*
* @return mixed
*/
protected function _cleanVar($var, $mask = 0, $type = null)
{
if (is_array($var))
{
$temp = [];
foreach ($var as $k => $v)
{
$temp[$k] = self::_cleanVar($v, $mask);
}
return $temp;
}
// If the no trim flag is not set, trim the variable
if (!($mask & 1) && is_string($var))
{
$var = trim($var);
}
// Now we handle input filtering
if ($mask & 2)
{
// If the allow raw flag is set, do not modify the variable
}
elseif ($mask & 4)
{
// If the allow HTML flag is set, apply a safe HTML filter to the variable
if (version_compare(JVERSION, '3.999.999', 'le'))
{
$safeHtmlFilter = InputFilter::getInstance(null, null, 1, 1);
}
else
{
/**
* @noinspection PhpDeprecationInspection
*/
$safeHtmlFilter = JFilterInput::getInstance([], [], 1, 1);
}
$var = $safeHtmlFilter->clean($var, $type);
}
else
{
$var = $this->filter->clean($var, $type);
}
return $var;
}
/**
* @param string $hash
*
* @return array
*/
protected function extractJoomlaSource($hash = 'REQUEST')
{
if (!in_array(strtoupper($hash), ['GET', 'POST', 'FILES', 'COOKIE', 'ENV', 'SERVER', 'REQUEST']))
{
$hash = 'REQUEST';
}
$hash = strtolower($hash);
try
{
$input = Factory::getApplication()->input;
}
catch (Exception $e)
{
$input = new JoomlaInput();
}
if ($hash !== 'request')
{
$input = $input->{$hash};
}
$refObject = new ReflectionObject($input);
$refProp = $refObject->getProperty('data');
$refProp->setAccessible(true);
return $refProp->getValue($input) ?? [];
}
}
home/digilove/public_html/110/libraries/vendor/joomla/input/src/Input.php 0000644 00000022725 15243306322 0022401 0 ustar 00 <?php
/**
* Part of the Joomla Framework Input Package
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Input;
use Joomla\Filter;
/**
* Joomla! Input Base Class
*
* This is an abstracted input class used to manage retrieving data from the application environment.
*
* @since 1.0
*
* @property-read Input $get
* @property-read Input $post
* @property-read Input $request
* @property-read Input $server
* @property-read Input $env
* @property-read Files $files
* @property-read Cookie $cookie
*
* @method integer getInt($name, $default = null) Get a signed integer.
* @method integer getUint($name, $default = null) Get an unsigned integer.
* @method float getFloat($name, $default = null) Get a floating-point number.
* @method boolean getBool($name, $default = null) Get a boolean value.
* @method string getWord($name, $default = null) Get a word.
* @method string getAlnum($name, $default = null) Get an alphanumeric string.
* @method string getCmd($name, $default = null) Get a CMD filtered string.
* @method string getBase64($name, $default = null) Get a base64 encoded string.
* @method string getString($name, $default = null) Get a string.
* @method string getHtml($name, $default = null) Get a HTML string.
* @method string getPath($name, $default = null) Get a file path.
* @method string getUsername($name, $default = null) Get a username.
*/
class Input implements \Serializable, \Countable
{
/**
* Container with allowed superglobals
*
* @var array
* @since 1.3.0
* @note Once PHP 7.1 is the minimum supported version this should become a private constant
*/
private static $allowedGlobals = array('REQUEST', 'GET', 'POST', 'FILES', 'SERVER', 'ENV');
/**
* Options array for the Input instance.
*
* @var array
* @since 1.0
*/
protected $options = array();
/**
* Filter object to use.
*
* @var Filter\InputFilter
* @since 1.0
*/
protected $filter;
/**
* Input data.
*
* @var array
* @since 1.0
*/
protected $data = array();
/**
* Input objects
*
* @var Input[]
* @since 1.0
*/
protected $inputs = array();
/**
* Is all GLOBAL added
*
* @var boolean
* @since 1.1.4
*/
protected static $loaded = false;
/**
* Constructor.
*
* @param array $source Optional source data. If omitted, a copy of the server variable '_REQUEST' is used.
* @param array $options An optional associative array of configuration parameters:
* filter: An instance of Filter\Input. If omitted, a default filter is initialised.
*
* @since 1.0
*/
public function __construct($source = null, array $options = array())
{
if (isset($options['filter']))
{
$this->filter = $options['filter'];
}
else
{
$this->filter = new Filter\InputFilter;
}
if ($source === null)
{
$this->data = &$_REQUEST;
}
else
{
$this->data = $source;
}
// Set the options for the class.
$this->options = $options;
}
/**
* Magic method to get an input object
*
* @param mixed $name Name of the input object to retrieve.
*
* @return Input The request input object
*
* @since 1.0
*/
public function __get($name)
{
if (isset($this->inputs[$name]))
{
return $this->inputs[$name];
}
$className = '\\Joomla\\Input\\' . ucfirst($name);
if (class_exists($className))
{
$this->inputs[$name] = new $className(null, $this->options);
return $this->inputs[$name];
}
$superGlobal = '_' . strtoupper($name);
if (\in_array(strtoupper($name), self::$allowedGlobals, true) && isset($GLOBALS[$superGlobal]))
{
$this->inputs[$name] = new Input($GLOBALS[$superGlobal], $this->options);
return $this->inputs[$name];
}
// TODO throw an exception
}
/**
* Get the number of variables.
*
* @return integer The number of variables in the input.
*
* @since 1.0
* @see Countable::count()
*/
public function count()
{
return \count($this->data);
}
/**
* Gets a value from the input data.
*
* @param string $name Name of the value to get.
* @param mixed $default Default value to return if variable does not exist.
* @param string $filter Filter to apply to the value.
*
* @return mixed The filtered input value.
*
* @see \Joomla\Filter\InputFilter::clean()
* @since 1.0
*/
public function get($name, $default = null, $filter = 'cmd')
{
if (isset($this->data[$name]))
{
return $this->filter->clean($this->data[$name], $filter);
}
return $default;
}
/**
* Gets an array of values from the request.
*
* @param array $vars Associative array of keys and filter types to apply.
* If empty and datasource is null, all the input data will be returned
* but filtered using the default case in JFilterInput::clean.
* @param mixed $datasource Array to retrieve data from, or null
*
* @return mixed The filtered input data.
*
* @since 1.0
*/
public function getArray(array $vars = array(), $datasource = null)
{
if (empty($vars) && $datasource === null)
{
$vars = $this->data;
}
$results = array();
foreach ($vars as $k => $v)
{
if (\is_array($v))
{
if ($datasource === null)
{
$results[$k] = $this->getArray($v, $this->get($k, null, 'array'));
}
else
{
$results[$k] = $this->getArray($v, $datasource[$k]);
}
}
else
{
if ($datasource === null)
{
$results[$k] = $this->get($k, null, $v);
}
elseif (isset($datasource[$k]))
{
$results[$k] = $this->filter->clean($datasource[$k], $v);
}
else
{
$results[$k] = $this->filter->clean(null, $v);
}
}
}
return $results;
}
/**
* Get the Input instance holding the data for the current request method
*
* @return Input
*
* @since 1.3.0
*/
public function getInputForRequestMethod()
{
switch (strtoupper($this->getMethod()))
{
case 'GET':
return $this->get;
case 'POST':
return $this->post;
default:
// PUT, PATCH, etc. don't have superglobals
return $this;
}
}
/**
* Sets a value
*
* @param string $name Name of the value to set.
* @param mixed $value Value to assign to the input.
*
* @return void
*
* @since 1.0
*/
public function set($name, $value)
{
$this->data[$name] = $value;
}
/**
* Define a value. The value will only be set if there's no value for the name or if it is null.
*
* @param string $name Name of the value to define.
* @param mixed $value Value to assign to the input.
*
* @return void
*
* @since 1.0
*/
public function def($name, $value)
{
if (isset($this->data[$name]))
{
return;
}
$this->data[$name] = $value;
}
/**
* Check if a value name exists.
*
* @param string $name Value name
*
* @return boolean
*
* @since 1.2.0
*/
public function exists($name)
{
return isset($this->data[$name]);
}
/**
* Magic method to get filtered input data.
*
* @param string $name Name of the filter type prefixed with 'get'.
* @param array $arguments [0] The name of the variable [1] The default value.
*
* @return mixed The filtered input value.
*
* @since 1.0
*/
public function __call($name, $arguments)
{
if (substr($name, 0, 3) == 'get')
{
$filter = substr($name, 3);
$default = null;
if (isset($arguments[1]))
{
$default = $arguments[1];
}
return $this->get($arguments[0], $default, $filter);
}
}
/**
* Gets the request method.
*
* @return string The request method.
*
* @since 1.0
*/
public function getMethod()
{
$method = strtoupper($_SERVER['REQUEST_METHOD']);
return $method;
}
/**
* Method to serialize the input.
*
* @return string The serialized input.
*
* @since 1.0
*/
public function serialize()
{
// Load all of the inputs.
$this->loadAllInputs();
// Remove $_ENV and $_SERVER from the inputs.
$inputs = $this->inputs;
unset($inputs['env'], $inputs['server']);
// Serialize the options, data, and inputs.
return serialize(array($this->options, $this->data, $inputs));
}
/**
* Method to unserialize the input.
*
* @param string $input The serialized input.
*
* @return void
*
* @since 1.0
*/
public function unserialize($input)
{
// Unserialize the options, data, and inputs.
list($this->options, $this->data, $this->inputs) = unserialize($input);
// Load the filter.
if (isset($this->options['filter']))
{
$this->filter = $this->options['filter'];
}
else
{
$this->filter = new Filter\InputFilter;
}
}
/**
* Method to load all of the global inputs.
*
* @return void
*
* @since 1.0
*/
protected function loadAllInputs()
{
if (!self::$loaded)
{
// Load up all the globals.
foreach ($GLOBALS as $global => $data)
{
// Check if the global starts with an underscore and is allowed.
if (strpos($global, '_') === 0 && \in_array(substr($global, 1), self::$allowedGlobals, true))
{
// Convert global name to input name.
$global = strtolower($global);
$global = substr($global, 1);
// Get the input.
$this->$global;
}
}
self::$loaded = true;
}
}
}