aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/auth/auth_db.php6
-rw-r--r--phpBB/includes/classes/session.php4
-rw-r--r--phpBB/includes/classes/user.php2
-rw-r--r--phpBB/includes/core/request.php562
-rw-r--r--phpBB/includes/db/dbal.php2
-rw-r--r--phpBB/includes/functions.php477
-rw-r--r--phpBB/includes/functions_display.php12
-rw-r--r--phpBB/includes/functions_module.php2
-rw-r--r--phpBB/includes/functions_privmsgs.php4
-rw-r--r--phpBB/includes/functions_profile_fields.php44
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/message_parser.php6
12 files changed, 627 insertions, 496 deletions
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 2744b16c53..82750936f1 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -100,14 +100,14 @@ function login_db(&$username, &$password)
/*if ($row['user_pass_convert'])
{
// in phpBB2 passwords were used exactly as they were sent, with addslashes applied
- $disabled = request::super_globals_disabled();
- request::enable_super_globals();
+ $disabled = phpbb_request::super_globals_disabled();
+ phpbb_request::enable_super_globals();
$password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
$password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
$password_new_format = '';
if ($disabled)
{
- request::disable_super_globals();
+ phpbb_request::disable_super_globals();
}
set_var($password_new_format, stripslashes($password_old_format), 'string');
diff --git a/phpBB/includes/classes/session.php b/phpBB/includes/classes/session.php
index b8f829efd5..5a42fdaac2 100644
--- a/phpBB/includes/classes/session.php
+++ b/phpBB/includes/classes/session.php
@@ -128,7 +128,7 @@ abstract class phpbb_session
$this->cookie_data = array('u' => 0, 'k' => '');
$this->update_session_page = $update_session_page;
- if (request::is_set(phpbb::$config['cookie_name'] . '_sid', request::COOKIE) || request::is_set(phpbb::$config['cookie_name'] . '_u', request::COOKIE))
+ if (phpbb_request::is_set(phpbb::$config['cookie_name'] . '_sid', phpbb_request::COOKIE) || phpbb_request::is_set(phpbb::$config['cookie_name'] . '_u', phpbb_request::COOKIE))
{
$this->cookie_data['u'] = request_var(phpbb::$config['cookie_name'] . '_u', 0, false, true);
$this->cookie_data['k'] = request_var(phpbb::$config['cookie_name'] . '_k', '', false, true);
@@ -1017,7 +1017,7 @@ abstract class phpbb_session
private function session_exist()
{
// If session is empty or does not match the session within the URL (if required - set by NEED_SID), then we need a new session
- if (empty($this->session_id) || ($this->need_sid && $this->session_id !== request::variable('sid', '', false, request::GET)))
+ if (empty($this->session_id) || ($this->need_sid && $this->session_id !== phpbb_request::variable('sid', '', false, phpbb_request::GET)))
{
return false;
}
diff --git a/phpBB/includes/classes/user.php b/phpBB/includes/classes/user.php
index 22e2b5acd4..067d97e8cb 100644
--- a/phpBB/includes/classes/user.php
+++ b/phpBB/includes/classes/user.php
@@ -229,7 +229,7 @@ class phpbb_user extends phpbb_session
$this->add_lang($lang_set);
unset($lang_set);
- if (request::variable('style', false, false, request::GET) && phpbb::$acl->acl_get('a_styles'))
+ if (phpbb_request::variable('style', false, false, phpbb_request::GET) && phpbb::$acl->acl_get('a_styles'))
{
$style = request_var('style', 0);
$this->extra_url = array('style=' . $style);
diff --git a/phpBB/includes/core/request.php b/phpBB/includes/core/request.php
new file mode 100644
index 0000000000..53d9b34b6c
--- /dev/null
+++ b/phpBB/includes/core/request.php
@@ -0,0 +1,562 @@
+<?php
+/**
+*
+* @package core
+* @version $Id: request.php 9212 2008-12-21 19:15:55Z acydburn $
+* @copyright (c) 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Replacement for a superglobal (like $_GET or $_POST) which calls
+* trigger_error on any operation, overloads the [] operator using SPL.
+*
+* @package core
+* @author naderman
+*/
+class deactivated_super_global implements ArrayAccess, Countable, IteratorAggregate
+{
+ /**
+ * @var string Holds the error message
+ */
+ private $message;
+
+ /**
+ * Constructor generates an error message fitting the super global to be used within the other functions.
+ *
+ * @param string $name Name of the super global this is a replacement for - e.g. '_GET'
+ */
+ public function __construct($name)
+ {
+ $this->message = 'Illegal use of $' . $name . '. You must use the request class or request_var() to access input data. Found in %s on line %d. This error message was generated';
+ }
+
+ /**
+ * Calls trigger_error with the file and line number the super global was used in
+ *
+ * @access private
+ */
+ private function error()
+ {
+ $file = '';
+ $line = 0;
+
+ $backtrace = debug_backtrace();
+ if (isset($backtrace[1]))
+ {
+ $file = $backtrace[1]['file'];
+ $line = $backtrace[1]['line'];
+ }
+ trigger_error(sprintf($this->message, $file, $line), E_USER_ERROR);
+ }
+
+ /**#@+
+ * Part of the ArrayAccess implementation, will always result in a FATAL error
+ *
+ * @access public
+ */
+ public function offsetExists($offset)
+ {
+ $this->error();
+ }
+
+ public function offsetGet($offset)
+ {
+ $this->error();
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ $this->error();
+ }
+
+ public function offsetUnset($offset)
+ {
+ $this->error();
+ }
+ /**#@-*/
+
+ /**
+ * Part of the Countable implementation, will always result in a FATAL error
+ *
+ * @access public
+ */
+ public function count()
+ {
+ $this->error();
+ }
+
+ /**
+ * Part of the Traversable/IteratorAggregate implementation, will always result in a FATAL error
+ *
+ * @access public
+ */
+ public function getIterator()
+ {
+ $this->error();
+ }
+}
+
+/**
+* All application input is accessed through this class.
+*
+* It provides a method to disable access to input data through super globals.
+* This should force MOD authors to read about data validation.
+*
+* @package core
+* @author naderman
+*/
+class phpbb_request
+{
+ /**#@+
+ * Constant defining the super global
+ */
+ const POST = 0;
+ const GET = 1;
+ const REQUEST = 2;
+ const COOKIE = 3;
+ /**#@-*/
+
+ /**
+ * @var
+ */
+ protected static $initialised = false;
+
+ /**
+ * @var
+ */
+ protected static $super_globals_disabled = false;
+
+ /**
+ * @var array The names of super global variables that this class should protect if super globals are disabled
+ */
+ protected static $super_globals = array(phpbb_request::POST => '_POST', phpbb_request::GET => '_GET', phpbb_request::REQUEST => '_REQUEST', phpbb_request::COOKIE => '_COOKIE');
+
+ /**
+ * @var array An associative array that has the value of super global constants as keys and holds their data as values.
+ */
+ protected static $input;
+
+ /**
+ * Initialises the request class, that means it stores all input data in {@link $input self::$input}
+ *
+ * @access public
+ */
+ public static function init()
+ {
+ if (!self::$initialised)
+ {
+ foreach (self::$super_globals as $const => $super_global)
+ {
+ if ($const == phpbb_request::REQUEST)
+ {
+ continue;
+ }
+
+ self::$input[$const] = isset($GLOBALS[$super_global]) ? $GLOBALS[$super_global] : array();
+ }
+
+ // @todo far away from ideal... just a quick hack to let request_var() work again. The problem is that $GLOBALS['_REQUEST'] no longer exist.
+ self::$input[phpbb_request::REQUEST] = array_merge(self::$input[phpbb_request::POST], self::$input[phpbb_request::GET]);
+
+ self::$initialised = true;
+ }
+ }
+
+ /**
+ * Resets the request class.
+ * This will simply forget about all input data and read it again from the
+ * super globals, if super globals were disabled, all data will be gone.
+ *
+ * @access public
+ */
+ public static function reset()
+ {
+ self::$input = array();
+ self::$initialised = false;
+ self::$super_globals_disabled = false;
+ }
+
+ /**
+ * Getter for $super_globals_disabled
+ *
+ * @return bool Whether super globals are disabled or not.
+ * @access public
+ */
+ public static function super_globals_disabled()
+ {
+ return self::$super_globals_disabled;
+ }
+
+ /**
+ * Disables access of super globals specified in $super_globals.
+ * This is achieved by overwriting the super globals with instances of {@link deactivated_super_global deactivated_super_global}
+ *
+ * @access public
+ */
+ public static function disable_super_globals()
+ {
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ foreach (self::$super_globals as $const => $super_global)
+ {
+ unset($GLOBALS[$super_global]);
+ $GLOBALS[$super_global] = new deactivated_super_global($super_global);
+ }
+
+ self::$super_globals_disabled = true;
+ }
+
+ /**
+ * Enables access of super globals specified in $super_globals if they were disabled by {@link disable_super_globals disable_super_globals}.
+ * This is achieved by making the super globals point to the data stored within this class in {@link $input input}.
+ *
+ * @access public
+ */
+ public static function enable_super_globals()
+ {
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ if (self::$super_globals_disabled)
+ {
+ foreach (self::$super_globals as $const => $super_global)
+ {
+ $GLOBALS[$super_global] = self::$input[$const];
+ }
+
+ self::$super_globals_disabled = false;
+ }
+ }
+
+ /**
+ * Recursively applies addslashes to a variable.
+ *
+ * @param mixed &$var Variable passed by reference to which slashes will be added.
+ * @access protected
+ */
+ protected static function addslashes_recursively(&$var)
+ {
+ if (is_string($var))
+ {
+ $var = addslashes($var);
+ }
+ else if (is_array($var))
+ {
+ $var_copy = $var;
+ foreach ($var_copy as $key => $value)
+ {
+ if (is_string($key))
+ {
+ $key = addslashes($key);
+ }
+ self::addslashes_recursively($var[$key]);
+ }
+ }
+ }
+
+ /**
+ * This function allows overwriting or setting a value in one of the super global arrays.
+ *
+ * Changes which are performed on the super globals directly will not have any effect on the results of
+ * other methods this class provides. Using this function should be avoided if possible! It will
+ * consume twice the the amount of memory of the value
+ *
+ * @param string $var_name The name of the variable that shall be overwritten
+ * @param mixed $value The value which the variable shall contain.
+ * If this is null the variable will be unset.
+ * @param phpbb_request::POST|phpbb_request::GET|phpbb_request::REQUEST|phpbb_request::COOKIE $super_global Specifies which super global shall be changed
+ *
+ * @access public
+ */
+ public static function overwrite($var_name, $value, $super_global = phpbb_request::REQUEST)
+ {
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ if (!isset(self::$super_globals[$super_global]))
+ {
+ return;
+ }
+
+ if (STRIP)
+ {
+ self::addslashes_recursively($value);
+ }
+
+ // setting to null means unsetting
+ if ($value === null)
+ {
+ unset(self::$input[$super_global][$var_name]);
+ if (!self::super_globals_disabled())
+ {
+ unset($GLOBALS[self::$super_globals[$super_global]][$var_name]);
+ }
+ }
+ else
+ {
+ self::$input[$super_global][$var_name] = $value;
+ if (!self::super_globals_disabled())
+ {
+ $GLOBALS[self::$super_globals[$super_global]][$var_name] = $value;
+ }
+ }
+
+ if (!self::super_globals_disabled())
+ {
+ unset($GLOBALS[self::$super_globals[$super_global]][$var_name]);
+ $GLOBALS[self::$super_globals[$super_global]][$var_name] = $value;
+ }
+ }
+
+ /**
+ * Set variable $result. Used by {@link request_var() the request_var function}
+ *
+ * @param mixed &$result The variable to fill
+ * @param mixed $var The contents to fill with
+ * @param mixed $type The variable type. Will be used with {@link settype()}
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ *
+ * @access public
+ */
+ public static function set_var(&$result, $var, $type, $multibyte = false)
+ {
+ settype($var, $type);
+ $result = $var;
+
+ if ($type == 'string')
+ {
+ $result = trim(utf8_htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result)));
+
+ if (!empty($result))
+ {
+ // Make sure multibyte characters are wellformed
+ if ($multibyte)
+ {
+ if (!preg_match('/^./u', $result))
+ {
+ $result = '';
+ }
+ }
+ else
+ {
+ // no multibyte, allow only ASCII (0-127)
+ $result = preg_replace('/[\x80-\xFF]/', '?', $result);
+ }
+ }
+
+ $result = (STRIP) ? stripslashes($result) : $result;
+ }
+ }
+
+ /**
+ * Recursively sets a variable to a given type using {@link set_var() set_var}
+ * This function is only used from within {@link phpbb_request::variable phpbb_request::variable}.
+ *
+ * @param string $var The value which shall be sanitised (passed by reference).
+ * @param mixed $default Specifies the type $var shall have.
+ * If it is an array and $var is not one, then an empty array is returned.
+ * Otherwise var is cast to the same type, and if $default is an array all keys and values are cast recursively using this function too.
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ *
+ * @access protected
+ */
+ protected static function recursive_set_var(&$var, $default, $multibyte)
+ {
+ if (is_array($var) !== is_array($default))
+ {
+ $var = (is_array($default)) ? array() : $default;
+ return;
+ }
+
+ if (!is_array($default))
+ {
+ $type = gettype($default);
+ self::set_var($var, $var, $type, $multibyte);
+ }
+ else
+ {
+ // make sure there is at least one key/value pair to use get the
+ // types from
+ if (!sizeof($default))
+ {
+ $var = array();
+ return;
+ }
+
+ list($default_key, $default_value) = each($default);
+ $value_type = gettype($default_value);
+ $key_type = gettype($default_key);
+
+ $_var = $var;
+ $var = array();
+
+ foreach ($_var as $k => $v)
+ {
+ self::set_var($k, $k, $key_type, $multibyte);
+
+ self::recursive_set_var($v, $default_value, $multibyte);
+ self::set_var($var[$k], $v, $value_type, $multibyte);
+ }
+ }
+ }
+
+ /**
+ * Central type safe input handling function.
+ * All variables in GET or POST requests should be retrieved through this function to maximise security.
+ *
+ * @param string|array $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param phpbb_request::POST|phpbb_request::GET|phpbb_request::REQUEST|phpbb_request::COOKIE $super_global Specifies which super global should be used
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ * @access public
+ */
+ public static function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request::REQUEST)
+ {
+ $path = false;
+
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ // deep direct access to multi dimensional arrays
+ if (is_array($var_name))
+ {
+ $path = $var_name;
+ // make sure at least the variable name is specified
+ if (!sizeof($path))
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ // the variable name is the first element on the path
+ $var_name = array_shift($path);
+ }
+
+ if (!isset(self::$input[$super_global][$var_name]))
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ $var = self::$input[$super_global][$var_name];
+
+ // make sure cookie does not overwrite get/post
+ if ($super_global != phpbb_request::COOKIE && isset(self::$input[phpbb_request::COOKIE][$var_name]))
+ {
+ if (!isset(self::$input[phpbb_request::GET][$var_name]) && !isset(self::$input[phpbb_request::POST][$var_name]))
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ $var = isset(self::$input[phpbb_request::POST][$var_name]) ? self::$input[phpbb_request::POST][$var_name] : self::$input[phpbb_request::GET][$var_name];
+ }
+
+ if ($path)
+ {
+ // walk through the array structure and find the element we are looking for
+ foreach ($path as $key)
+ {
+ if (is_array($var) && isset($var[$key]))
+ {
+ $var = $var[$key];
+ }
+ else
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ }
+ }
+
+ self::recursive_set_var($var, $default, $multibyte);
+
+ return $var;
+ }
+
+ /**
+ * Checks whether a certain variable was sent via POST.
+ * To make sure that a request was sent using POST you should call this function
+ * on at least one variable.
+ *
+ * @param string $name The name of the form variable which should have a
+ * _p suffix to indicate the check in the code that creates the form too.
+ *
+ * @return bool True if the variable was set in a POST request, false otherwise.
+ * @access public
+ */
+ public static function is_set_post($name)
+ {
+ return self::is_set($name, phpbb_request::POST);
+ }
+
+ /**
+ * Checks whether a certain variable is set in one of the super global
+ * arrays.
+ *
+ * @param string $var Name of the variable
+ * @param phpbb_request::POST|phpbb_request::GET|phpbb_request::REQUEST|phpbb_request::COOKIE $super_global
+ * Specifies the super global which shall be checked
+ *
+ * @return bool True if the variable was sent as input
+ * @access public
+ */
+ public static function is_set($var, $super_global = phpbb_request::REQUEST)
+ {
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ return isset(self::$input[$super_global][$var]);
+ }
+
+ /**
+ * Returns all variable names for a given super global
+ *
+ * @param phpbb_request::POST|phpbb_request::GET|phpbb_request::REQUEST|phpbb_request::COOKIE $super_global
+ * The super global from which names shall be taken
+ *
+ * @return array All variable names that are set for the super global.
+ * Pay attention when using these, they are unsanitised!
+ * @access public
+ */
+ public static function variable_names($super_global = phpbb_request::REQUEST)
+ {
+ if (!self::$initialised)
+ {
+ self::init();
+ }
+
+ if (!isset(self::$input[$super_global]))
+ {
+ return array();
+ }
+
+ return array_keys(self::$input[$super_global]);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 885ae5a0cb..ddb3aef4d7 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -677,7 +677,7 @@ class dbal
{
global $cache, $starttime, $user;
- if (!request::variable('explain', false))
+ if (!phpbb_request::variable('explain', false))
{
return false;
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2c6e24deeb..b8ca86bc07 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -108,448 +108,17 @@ class deactivated_super_global implements ArrayAccess, Countable, IteratorAggreg
}
/**
-* All application input is accessed through this class. It provides a method
-* to disable access to input data through super globals. This should force MOD
-* authors to read about data validation.
-* @package phpBB3
-*/
-class request
-{
- const POST = 0;
- const GET = 1;
- const REQUEST = 2;
- const COOKIE = 3;
-
- protected static $initialised = false;
- protected static $super_globals_disabled = false;
-
- /**
- * The names of super global variables that this class should protect
- * if super globals are disabled
- */
- protected static $super_globals = array(request::POST => '_POST', request::GET => '_GET', request::REQUEST => '_REQUEST', request::COOKIE => '_COOKIE');
-
- /**
- * An associative array that has the value of super global constants as
- * keys and holds their data as values.
- */
- protected static $input;
-
- /**
- * Initialises the request class, that means it stores all input data in
- * self::$input
- */
- public static function init()
- {
- if (!self::$initialised)
- {
- foreach (self::$super_globals as $const => $super_global)
- {
- self::$input[$const] = $GLOBALS[$super_global];
- }
-
- self::$initialised = true;
- }
- }
-
- /**
- * Resets the request class.
- * This will simply forget about all input data and read it again from the
- * super globals, if super globals were disabled, all data will be gone.
- */
- public static function reset()
- {
- self::$input = array();
- self::$initialised = false;
- self::$super_globals_disabled = false;
- }
-
- /**
- * Getter for $super_globals_disabled
- * @return bool Whether super globals are disabled or not.
- */
- public static function super_globals_disabled()
- {
- return self::$super_globals_disabled;
- }
-
- /**
- * Disables access of super globals specified in $super_globals.
- * This is achieved by overwriting the super globals with instances of
- * {@link deactivated_super_global deactivated_super_global}
- */
- public static function disable_super_globals()
- {
- if (!self::$initialised)
- {
- self::init();
- }
-
- foreach (self::$super_globals as $const => $super_global)
- {
- unset($GLOBALS[$super_global]);
- $GLOBALS[$super_global] = new deactivated_super_global($super_global);
- }
-
- self::$super_globals_disabled = true;
- }
-
- /**
- * Enables access of super globals specified in $super_globals if they were
- * disabled by {@link disable_super_globals disable_super_globals}.
- * This is achieved by making the super globals point to the data stored
- * within this class in {@link input input}.
- */
- public static function enable_super_globals()
- {
- if (!self::$initialised)
- {
- self::init();
- }
-
- if (self::$super_globals_disabled)
- {
- foreach (self::$super_globals as $const => $super_global)
- {
- $GLOBALS[$super_global] = self::$input[$const];
- }
-
- self::$super_globals_disabled = false;
- }
- }
-
- /**
- * Recursively applies addslashes to a variable.
- *
- * @param mixed $var Variable passed by reference to which slashes
- * will be added.
- */
- protected static function addslashes_recursively(&$var)
- {
- if (is_string($var))
- {
- $var = addslashes($var);
- }
- else if (is_array($var))
- {
- $var_copy = $var;
- foreach ($var_copy as $key => $value)
- {
- if (is_string($key))
- {
- $key = addslashes($key);
- }
- self::addslashes_recursively($var[$key]);
- }
- }
- }
-
- /**
- * This function allows overwriting or setting a value in one of the super
- * global arrays.
- * Changes which are performed on the super globals directly will not have
- * any effect on the results of other methods this class provides. Using
- * this function should be avoided if possible! It will consume twice the
- * the amount of memory of the value
- *
- * @param string $var_name The name of the variable that shall be
- * overwritten
- * @param mixed $value The value which the variable shall contain.
- * If this is null the variable will be unset.
- * @param request::POST|request::GET|request::REQUEST|request::COOKIE $super_global
- * Specifies which super global shall be changed
- */
- public static function overwrite($var_name, $value, $super_global = request::REQUEST)
- {
- if (!self::$initialised)
- {
- self::init();
- }
-
- if (!isset(self::$super_globals[$super_global]))
- {
- return;
- }
-
- if (STRIP)
- {
- self::addslashes_recursively($value);
- }
-
- // setting to null means unsetting
- if ($value === null)
- {
- unset(self::$input[$super_global][$var_name]);
- if (!self::super_globals_disabled())
- {
- unset($GLOBALS[self::$super_globals[$super_global]][$var_name]);
- }
- }
- else
- {
- self::$input[$super_global][$var_name] = $value;
- if (!self::super_globals_disabled())
- {
- $GLOBALS[self::$super_globals[$super_global]][$var_name] = $value;
- }
- }
-
- if (!self::super_globals_disabled())
- {
- unset($GLOBALS[self::$super_globals[$super_global]][$var_name]);
- $GLOBALS[self::$super_globals[$super_global]][$var_name] = $value;
- }
- }
-
- /**
- * Recursively sets a variable to a given type using {@link set_var set_var}
- * This function is only used from within {@link request::variable request::variable}.
- *
- * @param string $var The value which shall be sanitised (passed
- by reference).
- * @param mixed $default Specifies the type $var shall have. If it
- * is an array and $var is not one, then an
- * empty array is returned. Otherwise var
- * is cast to the same type, and if $default
- * is an array all keys and values are cast
- * recursively using this function too.
- * @param bool $multibyte Indicates whether string values may contain
- * UTF-8 characters. Default is false, causing
- * all bytes outside the ASCII range (0-127)
- * to be replaced with question marks.
- */
- protected static function recursive_set_var(&$var, $default, $multibyte)
- {
- if (is_array($var) !== is_array($default))
- {
- $var = (is_array($default)) ? array() : $default;
- return;
- }
-
- if (!is_array($default))
- {
- $type = gettype($default);
- set_var($var, $var, $type, $multibyte);
- }
- else
- {
- // make sure there is at least one key/value pair to use get the
- // types from
- if (!sizeof($default))
- {
- $var = array();
- return;
- }
-
- list($default_key, $default_value) = each($default);
- $value_type = gettype($default_value);
- $key_type = gettype($default_key);
-
- $_var = $var;
- $var = array();
-
- foreach ($_var as $k => $v)
- {
- set_var($k, $k, $key_type, $multibyte);
-
- self::recursive_set_var($v, $default_value, $multibyte);
- set_var($var[$k], $v, $value_type, $multibyte);
- }
- }
- }
-
- /**
- * Central type safe input handling function.
- * All variables in GET or POST requests should be retrieved through this
- * function to maximise security.
- *
- * @param string|array $var_name The form variable's name from which data
- * shall be retrieved. If the value is an array this
- * may be an array of indizes which will give direct
- * access to a value at any depth. E.g. if the value
- * of "var" is array(1 => "a") then specifying
- * array("var", 1) as the name will return "a".
- * @param mixed $default A default value that is returned if the variable
- * was not set. This function will always return a
- * a value of the same type as the default.
- * @param bool $multibyte If $default is a string this paramater has to be
- * true if the variable may contain any UTF-8 characters
- * Default is false, causing all bytes outside the ASCII
- * range (0-127) to be replaced with question marks
- * @param request::POST|request::GET|request::REQUEST|request::COOKIE $super_global
- * Specifies which super global should be used
- * @return mixed The value of $_REQUEST[$var_name] run through
- * {@link set_var set_var} to ensure that the type is the
- * the same as that of $default. If the variable is not set
- * $default is returned.
- */
- public static function variable($var_name, $default, $multibyte = false, $super_global = request::REQUEST)
- {
- $path = false;
-
- if (!self::$initialised)
- {
- self::init();
- }
-
- // deep direct access to multi dimensional arrays
- if (is_array($var_name))
- {
- $path = $var_name;
- // make sure at least the variable name is specified
- if (!sizeof($path))
- {
- return (is_array($default)) ? array() : $default;
- }
- // the variable name is the first element on the path
- $var_name = array_shift($path);
- }
-
- if (!isset(self::$input[$super_global][$var_name]))
- {
- return (is_array($default)) ? array() : $default;
- }
- $var = self::$input[$super_global][$var_name];
-
- // make sure cookie does not overwrite get/post
- if ($super_global != request::COOKIE && isset(self::$input[request::COOKIE][$var_name]))
- {
- if (!isset(self::$input[request::GET][$var_name]) && !isset(self::$input[request::POST][$var_name]))
- {
- return (is_array($default)) ? array() : $default;
- }
- $var = isset(self::$input[request::POST][$var_name]) ? self::$input[request::POST][$var_name] : self::$input[request::GET][$var_name];
- }
-
- if ($path)
- {
- // walk through the array structure and find the element we are looking for
- foreach ($path as $key)
- {
- if (is_array($var) && isset($var[$key]))
- {
- $var = $var[$key];
- }
- else
- {
- return (is_array($default)) ? array() : $default;
- }
- }
- }
-
- self::recursive_set_var($var, $default, $multibyte);
-
- return $var;
- }
-
- /**
- * Checks whether a certain variable was sent via POST.
- * To make sure that a request was sent using POST you should call this function
- * on at least one variable.
- *
- * @param string $name The name of the form variable which should have a
- * _p suffix to indicate the check in the code that
- * creates the form too.
- * @return bool True if the variable was set in a POST request,
- * false otherwise.
- */
- public static function is_set_post($name)
- {
- return self::is_set($name, request::POST);
- }
-
- /**
- * Checks whether a certain variable is set in one of the super global
- * arrays.
- *
- * @param string $var Name of the variable
- * @param request::POST|request::GET|request::REQUEST|request::COOKIE $super_global
- * Specifies the super global which shall be checked
- * @return bool True if the variable was sent as input
- */
- public static function is_set($var, $super_global = request::REQUEST)
- {
- if (!self::$initialised)
- {
- self::init();
- }
-
- return isset(self::$input[$super_global][$var]);
- }
-
- /**
- * Returns all variable names for a given super global
- *
- * @param request::POST|request::GET|request::REQUEST|request::COOKIE $super_global
- * The super global from which names shall be taken
- * @return array All variable names that are set for the super global.
- * Pay attention when using these, they are unsanitised!
- */
- public static function variable_names($super_global = request::REQUEST)
- {
- if (!self::$initialised)
- {
- self::init();
- }
-
- if (!isset(self::$input[$super_global]))
- {
- return array();
- }
-
- return array_keys(self::$input[$super_global]);
- }
-}
-
-/**
-* Wrapper function of request::variable which exists for backwards
+* Wrapper function of phpbb_request::variable which exists for backwards
* compatability.
-* See {@link request::variable request::variable} for documentation of this
+* See {@link phpbb_request::variable phpbb_request::variable} for documentation of this
* function's use.
-* @param bool $cookie This param is mapped to request::COOKIE as the last
-* param for request::variable for backwards
+* @param bool $cookie This param is mapped to phpbb_request::COOKIE as the last
+* param for phpbb_request::variable for backwards
* compatability reasons.
*/
function request_var($var_name, $default, $multibyte = false, $cookie = false)
{
- return request::variable($var_name, $default, $multibyte, ($cookie) ? request::COOKIE : request::REQUEST);
-}
-
-/**
-* set_var
-*
-* Set variable, used by {@link request_var the request_var function}
-*
-* @access private
-*/
-function set_var(&$result, $var, $type, $multibyte = false)
-{
- settype($var, $type);
- $result = $var;
-
- if ($type == 'string')
- {
- $result = trim(utf8_htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result)));
-
- if (!empty($result))
- {
- // Make sure multibyte characters are wellformed
- if ($multibyte)
- {
- if (!preg_match('/^./u', $result))
- {
- $result = '';
- }
- }
- else
- {
- // no multibyte, allow only ASCII (0-127)
- $result = preg_replace('/[\x80-\xFF]/', '?', $result);
- }
- }
-
- $result = (STRIP) ? stripslashes($result) : $result;
- }
+ return phpbb_request::variable($var_name, $default, $multibyte, ($cookie) ? phpbb_request::COOKIE : phpbb_request::REQUEST);
}
/**
@@ -1318,7 +887,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking_topics = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
unset($tracking_topics['tf']);
@@ -1327,7 +896,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$tracking_topics['l'] = base_convert(time() - $config['board_startdate'], 10, 36);
$user->set_cookie('track', tracking_serialize($tracking_topics), time() + 31536000);
- request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), request::COOKIE);
+ phpbb_request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), phpbb_request::COOKIE);
unset($tracking_topics);
@@ -1397,7 +966,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
foreach ($forum_id as $f_id)
@@ -1428,7 +997,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
$user->set_cookie('track', tracking_serialize($tracking), time() + 31536000);
- request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), request::COOKIE);
+ phpbb_request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request::COOKIE);
unset($tracking);
}
@@ -1469,7 +1038,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
$topic_id36 = base_convert($topic_id, 10, 36);
@@ -1484,7 +1053,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
// If the cookie grows larger than 10000 characters we will remove the smallest value
// This can result in old topics being unread - but most of the time it should be accurate...
- if (strlen(request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE)) > 10000)
+ if (strlen(phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE)) > 10000)
{
//echo 'Cookie grown too large' . print_r($tracking, true);
@@ -1524,7 +1093,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
$user->set_cookie('track', tracking_serialize($tracking), time() + 31536000);
- request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking));
+ phpbb_request::overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking));
}
return;
@@ -1706,7 +1275,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
if (!isset($tracking_topics) || !sizeof($tracking_topics))
{
- $tracking_topics = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking_topics = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
@@ -1789,7 +1358,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking_topics = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@@ -2631,7 +2200,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
$timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);
}
- if (request::is_set_post('creation_time') && request::is_set_post('form_token'))
+ if (phpbb_request::is_set_post('creation_time') && phpbb_request::is_set_post('form_token'))
{
$creation_time = abs(request_var('creation_time', 0));
$token = request_var('form_token', '');
@@ -2676,13 +2245,13 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
{
global $user, $template, $db;
- if (request::is_set_post('cancel'))
+ if (phpbb_request::is_set_post('cancel'))
{
return false;
}
$confirm = false;
- if (request::is_set_post('confirm'))
+ if (phpbb_request::is_set_post('confirm'))
{
// language frontier
if (request_var('confirm', '') === $user->lang['YES'])
@@ -2807,7 +2376,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN');
}
- if (request::is_set_post('login'))
+ if (phpbb_request::is_set_post('login'))
{
// Get credential
if ($admin)
@@ -2831,8 +2400,8 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
}
$username = request_var('username', '', true);
- $autologin = request::variable('autologin', false, false, request::POST);
- $viewonline = (request::variable('viewonline', false, false, request::POST)) ? 0 : 1;
+ $autologin = phpbb_request::variable('autologin', false, false, phpbb_request::POST);
+ $viewonline = (phpbb_request::variable('viewonline', false, false, phpbb_request::POST)) ? 0 : 1;
$admin = ($admin) ? 1 : 0;
$viewonline = ($admin) ? $user->data['session_viewonline'] : $viewonline;
@@ -4018,7 +3587,7 @@ function page_footer($run_cron = true)
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
- if (request::variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
+ if (phpbb_request::variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
{
$db->sql_report('display');
}
@@ -4128,9 +3697,9 @@ function exit_handler()
global $phpbb_hook, $config;
// needs to be run prior to the hook
- if (request::super_globals_disabled())
+ if (phpbb_request::super_globals_disabled())
{
- request::enable_super_globals();
+ phpbb_request::enable_super_globals();
}
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__))
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 9fa6a2bf01..0936279fde 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -68,7 +68,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = request::variable($config['cookie_name'] . '_track', '', false, request::COOKIE);
+ $tracking_topics = phpbb_request::variable($config['cookie_name'] . '_track', '', false, phpbb_request::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@@ -1044,7 +1044,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if (!is_null($notify_status) && $notify_status !== '')
{
- if (request::is_set('unwatch', request::GET))
+ if (phpbb_request::is_set('unwatch', phpbb_request::GET))
{
$uid = request_var('uid', 0);
if ($uid != $user_id)
@@ -1053,7 +1053,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
- if (request::variable('unwatch', '', false, request::GET) == $mode)
+ if (phpbb_request::variable('unwatch', '', false, phpbb_request::GET) == $mode)
{
$is_watching = 0;
@@ -1086,12 +1086,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
}
else
{
- if (request::is_set('watch', request::GET))
+ if (phpbb_request::is_set('watch', phpbb_request::GET))
{
$token = request_var('hash', '');
$redirect_url = append_sid("view$mode", "$u_url=$match_id&amp;start=$start");
- if (request::variable('watch', '', false, request::GET) == $mode && check_link_hash($token, "{$mode}_$match_id"))
+ if (phpbb_request::variable('watch', '', false, phpbb_request::GET) == $mode && check_link_hash($token, "{$mode}_$match_id"))
{
$is_watching = true;
@@ -1117,7 +1117,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
}
else
{
- if (request::variable('unwatch', '', false, request::GET) == $mode)
+ if (phpbb_request::variable('unwatch', '', false, phpbb_request::GET) == $mode)
{
login_box();
}
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 404a5e5a09..2899848009 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -358,7 +358,7 @@ class p_master
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
$is_auth = false;
- eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', 'request::variable(\'\\1\', false)'), $module_auth) . ');');
+ eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', 'phpbb_request::variable(\'\\1\', false)'), $module_auth) . ');');
return $is_auth;
}
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 1362948b7e..c67266e9c5 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -870,7 +870,7 @@ function handle_mark_actions($user_id, $mark_action)
$msg_ids = request_var('marked_msg_id', array(0));
$cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
- $confirm = request::is_set_post('confirm');
+ $confirm = phpbb_request::is_set_post('confirm');
if (!sizeof($msg_ids))
{
@@ -1348,7 +1348,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . '
AND ug.user_pending = 0
AND u.user_id = ug.user_id
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
$sql_allow_pm;
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 37bd730033..8ae2f7fced 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -106,7 +106,7 @@ class custom_profile
{
case FIELD_DATE:
$field_validate = explode('-', $field_value);
-
+
$day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
$month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
$year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
@@ -154,14 +154,14 @@ class custom_profile
return 'FIELD_TOO_LARGE';
}
break;
-
+
case FIELD_DROPDOWN:
if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
}
break;
-
+
case FIELD_STRING:
case FIELD_TEXT:
if (empty($field_value) && !$field_data['field_required'])
@@ -205,7 +205,7 @@ class custom_profile
global $db, $user, $auth;
$this->profile_cache = array();
-
+
// Display hidden/no_view fields for admin/moderator
$sql = 'SELECT l.*, f.*
FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
@@ -318,12 +318,12 @@ class custom_profile
case 'FIELD_TOO_SMALL':
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']);
break;
-
+
case 'FIELD_TOO_LONG':
case 'FIELD_TOO_LARGE':
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']);
break;
-
+
case 'FIELD_INVALID_CHARS':
switch ($row['field_validation'])
{
@@ -341,7 +341,7 @@ class custom_profile
}
break;
}
-
+
if ($error != '')
{
$cp_error[] = $error;
@@ -436,7 +436,7 @@ class custom_profile
'S_PROFILE_' . strtoupper($ident) => true
);
}
-
+
return $tpl_fields;
}
else
@@ -562,11 +562,11 @@ class custom_profile
// checkbox - only testing for isset
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
{
- $value = (request::is_set($profile_row['field_ident'])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
+ $value = (phpbb_request::is_set($profile_row['field_ident'])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
}
else if ($profile_row['field_type'] == FIELD_INT)
{
- if (request::is_set($profile_row['field_ident']))
+ if (phpbb_request::is_set($profile_row['field_ident']))
{
$value = (request_var($profile_row['field_ident'], '') === '') ? null : request_var($profile_row['field_ident'], $default_value);
}
@@ -590,8 +590,8 @@ class custom_profile
}
else
{
- $value = (request::is_set($profile_row['field_ident'])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
-
+ $value = (phpbb_request::is_set($profile_row['field_ident'])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
+
if (gettype($value) == 'string')
{
$value = utf8_normalize_nfc($value);
@@ -633,7 +633,7 @@ class custom_profile
$now = getdate();
- if (!request::is_set($profile_row['field_ident'] . '_day'))
+ if (!phpbb_request::is_set($profile_row['field_ident'] . '_day'))
{
if ($profile_row['field_default_value'] == 'now')
{
@@ -674,7 +674,7 @@ class custom_profile
$profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>";
}
unset($now);
-
+
$profile_row['field_value'] = 0;
$template->assign_block_vars(self::$profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
}
@@ -827,7 +827,7 @@ class custom_profile
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
}
$db->sql_freeresult($result);
-
+
return $cp_data;
}
@@ -838,14 +838,14 @@ class custom_profile
private function get_profile_field($profile_row)
{
global $config;
-
+
$var_name = 'pf_' . $profile_row['field_ident'];
-
+
switch ($profile_row['field_type'])
{
case FIELD_DATE:
- if (!request::is_set($var_name . '_day'))
+ if (!phpbb_request::is_set($var_name . '_day'))
{
if ($profile_row['field_default_value'] == 'now')
{
@@ -860,7 +860,7 @@ class custom_profile
$month = request_var($var_name . '_month', 0);
$year = request_var($var_name . '_year', 0);
}
-
+
$var = sprintf('%2d-%2d-%4d', $day, $month, $year);
break;
@@ -868,7 +868,7 @@ class custom_profile
// Checkbox
if ($profile_row['field_length'] == 2)
{
- $var = request::is_set($var_name) ? 1 : 0;
+ $var = phpbb_request::is_set($var_name) ? 1 : 0;
}
else
{
@@ -882,7 +882,7 @@ class custom_profile
break;
case FIELD_INT:
- if (request::is_set($var_name) && request_var($var_name, '') === '')
+ if (phpbb_request::is_set($var_name) && request_var($var_name, '') === '')
{
$var = NULL;
}
@@ -931,7 +931,7 @@ class custom_profile_admin extends custom_profile
return $validate_options;
}
-
+
/**
* Get string options for second step in ACP
*/
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 49b48cbdb5..8a72e775c5 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2170,7 +2170,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
$sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
}
}
- else if (request::is_set_post('delete') && $change_avatar)
+ else if (phpbb_request::is_set_post('delete') && $change_avatar)
{
$sql_ary['user_avatar'] = '';
$sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index b272750310..5bbadd4d4c 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1317,8 +1317,8 @@ class parse_message extends bbcode_firstpass
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
$upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false;
- $add_file = request::is_set_post('add_file');
- $delete_file = request::is_set_post('delete_file');
+ $add_file = phpbb_request::is_set_post('add_file');
+ $delete_file = phpbb_request::is_set_post('delete_file');
// First of all adjust comments if changed
$actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true));
@@ -1500,7 +1500,7 @@ class parse_message extends bbcode_firstpass
global $user, $db, $config;
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
- $attachment_data = request::variable('attachment_data', array(0 => array('' => '')), true, request::POST);
+ $attachment_data = phpbb_request::variable('attachment_data', array(0 => array('' => '')), true, phpbb_request::POST);
$this->attachment_data = array();
$check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id;