Server IP : 1.179.227.78 / Your IP : 10.104.4.41 Web Server : Apache System : Linux afdc-mdu34 5.4.0-153-generic #170-Ubuntu SMP Fri Jun 16 13:43:31 UTC 2023 x86_64 User : www ( 1001) PHP Version : 7.4.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/afdc-mdu34.rtarf.mi.th/joomla/libraries/vendor/joomla/input/src/ |
Upload File : |
<?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 Cookie Class * * @since 1.0 */ class Cookie extends Input { /** * Constructor. * * @param array $source Ignored. * @param array $options Array of configuration parameters (Optional) * * @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; } // Set the data source. $this->data = & $_COOKIE; // Set the options for the class. $this->options = $options; } /** * Sets a value * * @param string $name Name of the value to set. * @param mixed $value Value to assign to the input. * @param array $options An associative array which may have any of the keys expires, path, domain, * secure, httponly and samesite. The values have the same meaning as described * for the parameters with the same name. The value of the samesite element * should be either Lax or Strict. If any of the allowed options are not given, * their default values are the same as the default values of the explicit * parameters. If the samesite element is omitted, no SameSite cookie attribute * is set. * * @return void * * @link https://www.ietf.org/rfc/rfc2109.txt * @link https://php.net/manual/en/function.setcookie.php * * @since 1.0 * * @note As of 1.4.0, the (name, value, expire, path, domain, secure, httpOnly) signature is deprecated and will not be supported * when support for PHP 7.2 and earlier is dropped */ public function set($name, $value, $options = array()) { // BC layer to convert old method parameters. if (is_array($options) === false) { $argList = func_get_args(); $options = array( 'expires' => isset($argList[2]) === true ? $argList[2] : 0, 'path' => isset($argList[3]) === true ? $argList[3] : '', 'domain' => isset($argList[4]) === true ? $argList[4] : '', 'secure' => isset($argList[5]) === true ? $argList[5] : false, 'httponly' => isset($argList[6]) === true ? $argList[6] : false, ); } // Set the cookie if (version_compare(PHP_VERSION, '7.3', '>=')) { setcookie($name, $value, $options); } else { // Using the setcookie function before php 7.3, make sure we have default values. if (array_key_exists('expires', $options) === false) { $options['expires'] = 0; } if (array_key_exists('path', $options) === false) { $options['path'] = ''; } if (array_key_exists('domain', $options) === false) { $options['domain'] = ''; } if (array_key_exists('secure', $options) === false) { $options['secure'] = false; } if (array_key_exists('httponly', $options) === false) { $options['httponly'] = false; } setcookie($name, $value, $options['expires'], $options['path'], $options['domain'], $options['secure'], $options['httponly']); } $this->data[$name] = $value; } }