mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
add nils' request and super globals class
rename request:: to phpbb_request:: git-svn-id: file:///svn/phpbb/trunk@9230 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ddfef8d832
commit
5b9a3c9a7d
72 changed files with 1081 additions and 950 deletions
|
@ -175,7 +175,7 @@ function adm_page_footer($copyright_html = 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');
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
|
|||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
// enforce the use of the request class
|
||||
request::disable_super_globals();
|
||||
phpbb_request::disable_super_globals();
|
||||
|
||||
// Instantiate some basic classes
|
||||
$user = new user();
|
||||
|
|
|
@ -875,7 +875,7 @@ $submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;
|
|||
<p class="good">// Use request var and define a default variable (use the correct type)</p>
|
||||
<div class="codebox"><pre>
|
||||
$start = request_var('start', 0);
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
</pre></div>
|
||||
|
||||
<p class="bad">// $start is an int, the following use of request_var therefore is not allowed</p>
|
||||
|
|
|
@ -30,13 +30,13 @@ else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'
|
|||
exit;
|
||||
}
|
||||
|
||||
if (request::is_set('avatar', request::GET))
|
||||
if (phpbb_request::is_set('avatar', phpbb_request::GET))
|
||||
{
|
||||
// worst-case default
|
||||
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
|
||||
|
||||
$config = phpbb_cache::obtain_config();
|
||||
$filename = request::variable('avatar', '', false, request::GET);
|
||||
$filename = phpbb_request::variable('avatar', '', false, phpbb_request::GET);
|
||||
$avatar_group = false;
|
||||
$exit = false;
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
562
phpBB/includes/core/request.php
Normal file
562
phpBB/includes/core/request.php
Normal file
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -677,7 +677,7 @@ class dbal
|
|||
{
|
||||
global $cache, $starttime, $user;
|
||||
|
||||
if (!request::variable('explain', false))
|
||||
if (!phpbb_request::variable('explain', false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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__))
|
||||
|
|
|
@ -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&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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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,7 +590,7 @@ 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')
|
||||
{
|
||||
|
@ -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')
|
||||
{
|
||||
|
@ -845,7 +845,7 @@ class custom_profile
|
|||
{
|
||||
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')
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -381,7 +381,7 @@ class install_convert extends module
|
|||
$this->p_master->error($lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$src_dbms = request_var('src_dbms', $convertor_data['dbms']);
|
||||
$src_dbhost = request_var('src_dbhost', $convertor_data['dbhost']);
|
||||
|
@ -805,7 +805,7 @@ class install_convert extends module
|
|||
|
||||
if (!$current_table && !$skip_rows)
|
||||
{
|
||||
if (!request::variable('confirm', false))
|
||||
if (!phpbb_request::variable('confirm', false))
|
||||
{
|
||||
// If avatars / ranks / smilies folders are specified make sure they are writable
|
||||
$bad_folders = array();
|
||||
|
@ -966,7 +966,7 @@ class install_convert extends module
|
|||
));
|
||||
|
||||
return;
|
||||
} // if (!request::variable('confirm', false))
|
||||
} // if (!phpbb_request::variable('confirm', false))
|
||||
|
||||
$template->assign_block_vars('checks', array(
|
||||
'S_LEGEND' => true,
|
||||
|
|
|
@ -559,7 +559,7 @@ class install_install extends module
|
|||
$available_dbms = get_available_dbms(false, true);
|
||||
|
||||
// Has the user opted to test the connection?
|
||||
if (request::is_set_post('testdb'))
|
||||
if (phpbb_request::is_set_post('testdb'))
|
||||
{
|
||||
if (!isset($available_dbms[$data['dbms']]) || !$available_dbms[$data['dbms']]['AVAILABLE'])
|
||||
{
|
||||
|
@ -700,7 +700,7 @@ class install_install extends module
|
|||
|
||||
$data['default_lang'] = ($data['default_lang'] !== '') ? $data['default_lang'] : $data['language'];
|
||||
|
||||
if (request::is_set_post('check'))
|
||||
if (phpbb_request::is_set_post('check'))
|
||||
{
|
||||
$error = array();
|
||||
|
||||
|
@ -954,7 +954,7 @@ class install_install extends module
|
|||
}
|
||||
}
|
||||
|
||||
if (request::is_set_post('dldone'))
|
||||
if (phpbb_request::is_set_post('dldone'))
|
||||
{
|
||||
// Do a basic check to make sure that the file has been uploaded
|
||||
// Note that all we check is that the file has _something_ in it
|
||||
|
@ -981,7 +981,7 @@ class install_install extends module
|
|||
{
|
||||
// OK, so it didn't work let's try the alternatives
|
||||
|
||||
if (request::is_set_post('dlconfig'))
|
||||
if (phpbb_request::is_set_post('dlconfig'))
|
||||
{
|
||||
// They want a copy of the file to download, so send the relevant headers and dump out the data
|
||||
header('Content-Type: text/x-delimtext; name="config.' . PHP_EXT . '"');
|
||||
|
|
|
@ -208,7 +208,7 @@ class install_update extends module
|
|||
$this->include_file('includes/diff/renderer.' . PHP_EXT);
|
||||
|
||||
// Make sure we stay at the file check if checking the files again
|
||||
if (request::variable('check_again', false, false, request::POST))
|
||||
if (phpbb_request::variable('check_again', false, false, phpbb_request::POST))
|
||||
{
|
||||
$sub = $this->p_master->sub = 'file_check';
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ class install_update extends module
|
|||
$action = request_var('action', '');
|
||||
|
||||
// We are directly within an update. To make sure our update list is correct we check its status.
|
||||
$update_list = (request::variable('check_again', false, false, request::POST)) ? false : $cache->get('_update_list');
|
||||
$update_list = (phpbb_request::variable('check_again', false, false, phpbb_request::POST)) ? false : $cache->get('_update_list');
|
||||
$modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . PHP_EXT) : 0;
|
||||
|
||||
// Make sure the list is up-to-date
|
||||
|
@ -823,7 +823,7 @@ class install_update extends module
|
|||
|
||||
// Choose FTP, if not available use fsock...
|
||||
$method = basename(request_var('method', ''));
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$test_ftp_connection = request_var('test_connection', '');
|
||||
|
||||
if (!$method || !class_exists($method))
|
||||
|
|
|
@ -52,7 +52,7 @@ if (!$user->data['is_registered'])
|
|||
login_box('', $user->lang['LOGIN_EXPLAIN_MCP']);
|
||||
}
|
||||
|
||||
$quickmod = request::is_set('quickmod');
|
||||
$quickmod = phpbb_request::is_set('quickmod');
|
||||
$action = request_var('action', '');
|
||||
$action_ary = request_var('action', array('' => 0));
|
||||
$forum_action = request_var('forum_action', '');
|
||||
|
@ -61,7 +61,7 @@ if (sizeof($action_ary))
|
|||
{
|
||||
$action = key($action_ary);
|
||||
}
|
||||
else if (!empty($forum_action) && request::variable('sort', false, false, request::POST))
|
||||
else if (!empty($forum_action) && phpbb_request::variable('sort', false, false, phpbb_request::POST))
|
||||
{
|
||||
$action = $forum_action;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ switch ($mode)
|
|||
}
|
||||
|
||||
$start = request_var('start', 0);
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$default_key = 'c';
|
||||
$sort_key = request_var('sk', $default_key);
|
||||
|
@ -741,8 +741,8 @@ switch ($mode)
|
|||
$email_lang = request_var('lang', $config['default_lang']);
|
||||
$subject = utf8_normalize_nfc(request_var('subject', '', true));
|
||||
$message = utf8_normalize_nfc(request_var('message', '', true));
|
||||
$cc = request::is_set_post('cc_email');
|
||||
$submit = request::is_set_post('submit');
|
||||
$cc = phpbb_request::is_set_post('cc_email');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
@ -948,7 +948,7 @@ switch ($mode)
|
|||
// We validate form and field here, only id/class allowed
|
||||
$form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
|
||||
$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
|
||||
if (($mode == 'searchuser' || sizeof(array_intersect(request::variable_names(request::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
|
||||
if (($mode == 'searchuser' || sizeof(array_intersect(phpbb_request::variable_names(phpbb_request::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
|
||||
{
|
||||
$username = request_var('username', '', true);
|
||||
$email = strtolower(request_var('email', ''));
|
||||
|
@ -1238,7 +1238,7 @@ switch ($mode)
|
|||
|
||||
foreach ($check_params as $key => $call)
|
||||
{
|
||||
if (!request::is_set($key))
|
||||
if (!phpbb_request::is_set($key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class acp_attachments
|
|||
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
||||
|
||||
$error = $notify = array();
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$action = request_var('action', '');
|
||||
|
||||
$form_key = 'acp_attach';
|
||||
|
@ -128,7 +128,7 @@ class acp_attachments
|
|||
);
|
||||
|
||||
$this->new_config = $config;
|
||||
$cfg_array = (request::is_set('config')) ? request_var('config', array('' => '')) : $this->new_config;
|
||||
$cfg_array = (phpbb_request::is_set('config')) ? request_var('config', array('' => '')) : $this->new_config;
|
||||
$error = array();
|
||||
|
||||
// We validate the complete config if whished
|
||||
|
@ -297,7 +297,7 @@ class acp_attachments
|
|||
|
||||
case 'extensions':
|
||||
|
||||
if ($submit || request::is_set_post('add_extension_check'))
|
||||
if ($submit || phpbb_request::is_set_post('add_extension_check'))
|
||||
{
|
||||
if ($submit)
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ class acp_attachments
|
|||
// Add Extension?
|
||||
$add_extension = strtolower(request_var('add_extension', ''));
|
||||
$add_extension_group = request_var('add_group_select', 0);
|
||||
$add = request::is_set_post('add_extension_check');
|
||||
$add = phpbb_request::is_set_post('add_extension_check');
|
||||
|
||||
if ($add_extension && $add)
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ class acp_attachments
|
|||
$template->assign_vars(array(
|
||||
'S_EXTENSIONS' => true,
|
||||
'ADD_EXTENSION' => (isset($add_extension)) ? $add_extension : '',
|
||||
'GROUP_SELECT_OPTIONS' => (request::is_set_post('add_extension_check')) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'))
|
||||
'GROUP_SELECT_OPTIONS' => (phpbb_request::is_set_post('add_extension_check')) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'))
|
||||
);
|
||||
|
||||
$sql = 'SELECT *
|
||||
|
@ -512,10 +512,10 @@ class acp_attachments
|
|||
$size_select = request_var('size_select', 'b');
|
||||
$forum_select = request_var('forum_select', false);
|
||||
$allowed_forums = request_var('allowed_forums', array(0));
|
||||
$allow_in_pm = request::is_set_post('allow_in_pm');
|
||||
$allow_in_pm = phpbb_request::is_set_post('allow_in_pm');
|
||||
$max_filesize = request_var('max_filesize', 0);
|
||||
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
|
||||
$allow_group = request::is_set_post('allow_group');
|
||||
$allow_group = phpbb_request::is_set_post('allow_group');
|
||||
|
||||
if ($max_filesize == $config['max_filesize'])
|
||||
{
|
||||
|
@ -593,7 +593,7 @@ class acp_attachments
|
|||
);
|
||||
|
||||
$group_id = request_var('g', 0);
|
||||
$action = request::is_set_post('add');
|
||||
$action = phpbb_request::is_set_post('add');
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
|
@ -876,8 +876,8 @@ class acp_attachments
|
|||
|
||||
if ($submit)
|
||||
{
|
||||
$delete_files = array_keys(request::variable('delete', array('' => 0), false, request::POST));
|
||||
$add_files = array_keys(request::variable('add', array('' => 0), false, request::POST));
|
||||
$delete_files = array_keys(phpbb_request::variable('delete', array('' => 0), false, phpbb_request::POST));
|
||||
$add_files = array_keys(phpbb_request::variable('add', array('' => 0), false, phpbb_request::POST));
|
||||
$post_ids = request_var('post_id', array('' => 0));
|
||||
|
||||
if (sizeof($delete_files))
|
||||
|
@ -1231,14 +1231,14 @@ class acp_attachments
|
|||
{
|
||||
global $db, $user;
|
||||
|
||||
if (request::is_set('securesubmit'))
|
||||
if (phpbb_request::is_set('securesubmit'))
|
||||
{
|
||||
// Grab the list of entries
|
||||
$ips = request_var('ips', '');
|
||||
$ip_list = array_unique(explode("\n", $ips));
|
||||
$ip_list_log = implode(', ', $ip_list);
|
||||
|
||||
$ip_exclude = (int) request::variable('ipexclude', false, false, request::POST);
|
||||
$ip_exclude = (int) phpbb_request::variable('ipexclude', false, false, phpbb_request::POST);
|
||||
|
||||
$iplist = array();
|
||||
$hostlist = array();
|
||||
|
@ -1385,7 +1385,7 @@ class acp_attachments
|
|||
|
||||
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else if (request::is_set_post('unsecuresubmit'))
|
||||
else if (phpbb_request::is_set_post('unsecuresubmit'))
|
||||
{
|
||||
$unip_sql = request_var('unip', array(0));
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ class acp_ban
|
|||
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$bansubmit = request::is_set_post('bansubmit');
|
||||
$unbansubmit = request::is_set_post('unbansubmit');
|
||||
$bansubmit = phpbb_request::is_set_post('bansubmit');
|
||||
$unbansubmit = phpbb_request::is_set_post('unbansubmit');
|
||||
$current_time = time();
|
||||
|
||||
$user->add_lang(array('acp/ban', 'acp/users'));
|
||||
|
|
|
@ -32,7 +32,7 @@ class acp_board
|
|||
$user->add_lang('acp/board');
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$form_key = 'acp_board';
|
||||
add_form_key($form_key);
|
||||
|
@ -371,7 +371,7 @@ class acp_board
|
|||
}
|
||||
|
||||
$this->new_config = $config;
|
||||
$cfg_array = (request::is_set('config')) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
|
||||
$cfg_array = (phpbb_request::is_set('config')) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
|
||||
$error = array();
|
||||
|
||||
// We validate the complete config if whished
|
||||
|
|
|
@ -28,11 +28,11 @@ class acp_bots
|
|||
global $config, $db, $user, $auth, $template, $cache;
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$mark = request_var('mark', array(0));
|
||||
$bot_id = request_var('id', 0);
|
||||
|
||||
if (request::is_set_post('add'))
|
||||
if (phpbb_request::is_set_post('add'))
|
||||
{
|
||||
$action = 'add';
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class acp_captcha
|
|||
$configure = request_var('configure', false);
|
||||
|
||||
// Oh, they are just here for the view
|
||||
if (request::is_set('captcha_demo', request::GET))
|
||||
if (phpbb_request::is_set('captcha_demo', phpbb_request::GET))
|
||||
{
|
||||
$this->deliver_demo($selected);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class acp_database
|
|||
$this->page_title = 'ACP_DATABASE';
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MODE' => $mode
|
||||
|
|
|
@ -38,8 +38,8 @@ class acp_disallow
|
|||
$form_key = 'acp_disallow';
|
||||
add_form_key($form_key);
|
||||
|
||||
$disallow = request::is_set_post('disallow');
|
||||
$allow = request::is_set_post('allow');
|
||||
$disallow = phpbb_request::is_set_post('disallow');
|
||||
$allow = phpbb_request::is_set_post('allow');
|
||||
|
||||
if (($allow || $disallow) && !check_form_key($form_key))
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ class acp_email
|
|||
add_form_key($form_key);
|
||||
|
||||
// Set some vars
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$error = array();
|
||||
|
||||
$usernames = request_var('usernames', '', true);
|
||||
|
@ -48,7 +48,7 @@ class acp_email
|
|||
{
|
||||
// Error checking needs to go here ... if no subject and/or no message then skip
|
||||
// over the send and return to the form
|
||||
$use_queue = request::is_set_post('send_immediately');
|
||||
$use_queue = phpbb_request::is_set_post('send_immediately');
|
||||
$priority = request_var('mail_priority_flag', MAIL_NORMAL_PRIORITY);
|
||||
|
||||
if (!check_form_key($form_key))
|
||||
|
|
|
@ -36,7 +36,7 @@ class acp_forums
|
|||
add_form_key($form_key);
|
||||
|
||||
$action = request_var('action', '');
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
$forum_id = request_var('f', 0);
|
||||
|
||||
$this->parent_id = request_var('parent_id', 0);
|
||||
|
|
|
@ -37,14 +37,14 @@ class acp_groups
|
|||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
// Check and set some common vars
|
||||
$action = (request::is_set_post('add')) ? 'add' : ((request::is_set_post('addusers')) ? 'addusers' : request_var('action', ''));
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : ((phpbb_request::is_set_post('addusers')) ? 'addusers' : request_var('action', ''));
|
||||
$group_id = request_var('g', 0);
|
||||
$mark_ary = request_var('mark', array(0));
|
||||
$name_ary = request_var('usernames', '', true);
|
||||
$leader = request_var('leader', 0);
|
||||
$default = request_var('default', 0);
|
||||
$start = request_var('start', 0);
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
|
||||
// Clear some vars
|
||||
|
@ -303,8 +303,8 @@ class acp_groups
|
|||
$submit_ary = array(
|
||||
'colour' => request_var('group_colour', ''),
|
||||
'rank' => request_var('group_rank', 0),
|
||||
'receive_pm' => request::is_set('group_receive_pm') ? 1 : 0,
|
||||
'legend' => request::is_set('group_legend') ? 1 : 0,
|
||||
'receive_pm' => phpbb_request::is_set('group_receive_pm') ? 1 : 0,
|
||||
'legend' => phpbb_request::is_set('group_legend') ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients' => request_var('group_max_recipients', 0),
|
||||
'founder_manage' => 0,
|
||||
|
@ -312,7 +312,7 @@ class acp_groups
|
|||
|
||||
if ($user->data['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
$submit_ary['founder_manage'] = request::is_set('group_founder_manage') ? 1 : 0;
|
||||
$submit_ary['founder_manage'] = phpbb_request::is_set('group_founder_manage') ? 1 : 0;
|
||||
}
|
||||
|
||||
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
||||
|
@ -519,7 +519,7 @@ class acp_groups
|
|||
|
||||
$avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
|
||||
|
||||
$display_gallery = request::is_set_post('display_gallery');
|
||||
$display_gallery = phpbb_request::is_set_post('display_gallery');
|
||||
|
||||
if ($config['allow_avatar_local'] && $display_gallery)
|
||||
{
|
||||
|
|
|
@ -32,9 +32,9 @@ class acp_icons
|
|||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (request::is_set_post('edit')) ? 'edit' : $action;
|
||||
$action = (request::is_set_post('import')) ? 'import' : $action;
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (phpbb_request::is_set_post('edit')) ? 'edit' : $action;
|
||||
$action = (phpbb_request::is_set_post('import')) ? 'import' : $action;
|
||||
$icon_id = request_var('id', 0);
|
||||
|
||||
$mode = ($mode == 'smilies') ? 'smilies' : 'icons';
|
||||
|
@ -309,20 +309,20 @@ class acp_icons
|
|||
case 'modify':
|
||||
|
||||
// Get items to create/modify
|
||||
$images = array_keys(request::variable('image', array('' => 0), false, request::POST));
|
||||
$images = array_keys(phpbb_request::variable('image', array('' => 0), false, phpbb_request::POST));
|
||||
|
||||
// Now really get the items
|
||||
$image_id = request::variable('id', array('' => 0), false, request::POST);
|
||||
$image_order = request::variable('order', array('' => 0), false, request::POST);
|
||||
$image_width = request::variable('width', array('' => 0), false, request::POST);
|
||||
$image_height = request::variable('height', array('' => 0), false, request::POST);
|
||||
$image_add = request::variable('add_img', array('' => 0), false, request::POST);
|
||||
$image_display_on_posting = request::variable('display_on_posting', array('' => 0), false, request::POST);
|
||||
$image_id = phpbb_request::variable('id', array('' => 0), false, phpbb_request::POST);
|
||||
$image_order = phpbb_request::variable('order', array('' => 0), false, phpbb_request::POST);
|
||||
$image_width = phpbb_request::variable('width', array('' => 0), false, phpbb_request::POST);
|
||||
$image_height = phpbb_request::variable('height', array('' => 0), false, phpbb_request::POST);
|
||||
$image_add = phpbb_request::variable('add_img', array('' => 0), false, phpbb_request::POST);
|
||||
$image_display_on_posting = phpbb_request::variable('display_on_posting', array('' => 0), false, phpbb_request::POST);
|
||||
$image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true));
|
||||
$image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true));
|
||||
|
||||
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
|
||||
if (request::variable('add_additional_code', false, false, request::POST))
|
||||
if (phpbb_request::variable('add_additional_code', false, false, phpbb_request::POST))
|
||||
{
|
||||
$add_image = request_var('add_image', '');
|
||||
$add_code = utf8_normalize_nfc(request_var('add_code', '', true));
|
||||
|
@ -338,7 +338,7 @@ class acp_icons
|
|||
$image_width[$add_image] = request_var('add_width', 0);
|
||||
$image_height[$add_image] = request_var('add_height', 0);
|
||||
|
||||
if (request::variable('add_display_on_posting', false, false, request::POST))
|
||||
if (phpbb_request::variable('add_display_on_posting', false, false, phpbb_request::POST))
|
||||
{
|
||||
$image_display_on_posting[$add_image] = 1;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class acp_inactive
|
|||
$action = request_var('action', '');
|
||||
$mark = request_var('mark', array(0));
|
||||
$start = request_var('start', 0);
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
// Sort keys
|
||||
$sort_days = request_var('st', 0);
|
||||
|
|
|
@ -33,7 +33,7 @@ class acp_jabber
|
|||
include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if ($mode != 'settings')
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ class acp_language
|
|||
* inside the request class. Reducing some of the redundance of this code would certainly
|
||||
* not hurt either.
|
||||
*/
|
||||
request::enable_super_globals();
|
||||
phpbb_request::enable_super_globals();
|
||||
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
|
@ -47,27 +47,27 @@ class acp_language
|
|||
|
||||
// Check and set some common vars
|
||||
|
||||
$action = (request::is_set_post('update_details')) ? 'update_details' : '';
|
||||
$action = (request::is_set_post('download_file')) ? 'download_file' : $action;
|
||||
$action = (request::is_set_post('upload_file')) ? 'upload_file' : $action;
|
||||
$action = (request::is_set_post('upload_data')) ? 'upload_data' : $action;
|
||||
$action = (request::is_set_post('submit_file')) ? 'submit_file' : $action;
|
||||
$action = (request::is_set_post('remove_store')) ? 'details' : $action;
|
||||
$action = (phpbb_request::is_set_post('update_details')) ? 'update_details' : '';
|
||||
$action = (phpbb_request::is_set_post('download_file')) ? 'download_file' : $action;
|
||||
$action = (phpbb_request::is_set_post('upload_file')) ? 'upload_file' : $action;
|
||||
$action = (phpbb_request::is_set_post('upload_data')) ? 'upload_data' : $action;
|
||||
$action = (phpbb_request::is_set_post('submit_file')) ? 'submit_file' : $action;
|
||||
$action = (phpbb_request::is_set_post('remove_store')) ? 'details' : $action;
|
||||
|
||||
$submit = (empty($action) && !request::is_set_post('update') && !request::is_set_post('test_connection')) ? false : true;
|
||||
$submit = (empty($action) && !phpbb_request::is_set_post('update') && !phpbb_request::is_set_post('test_connection')) ? false : true;
|
||||
$action = (empty($action)) ? request_var('action', '') : $action;
|
||||
|
||||
$form_name = 'acp_lang';
|
||||
add_form_key('acp_lang');
|
||||
|
||||
$lang_id = request_var('id', 0);
|
||||
if (request::is_set_post('missing_file'))
|
||||
if (phpbb_request::is_set_post('missing_file'))
|
||||
{
|
||||
$missing_file = request_var('missing_file', array('' => 0));
|
||||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('language_file', key($missing_file));
|
||||
phpbb_request::overwrite('language_file', key($missing_file));
|
||||
}
|
||||
|
||||
$selected_lang_file = request_var('language_file', '|common.' . PHP_EXT);
|
||||
|
@ -141,7 +141,7 @@ class acp_language
|
|||
);
|
||||
|
||||
/**
|
||||
* @todo Do not use $_POST here, but request::variable which needs to support more dimensions
|
||||
* @todo Do not use $_POST here, but phpbb_request::variable which needs to support more dimensions
|
||||
*/
|
||||
$hidden_data .= build_hidden_fields(array('entry' => $_POST['entry']), true, STRIP);
|
||||
|
||||
|
@ -502,7 +502,7 @@ class acp_language
|
|||
}
|
||||
}
|
||||
|
||||
if (request::is_set_post('remove_store'))
|
||||
if (phpbb_request::is_set_post('remove_store'))
|
||||
{
|
||||
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ class acp_logs
|
|||
$action = request_var('action', '');
|
||||
$forum_id = request_var('f', 0);
|
||||
$start = request_var('start', 0);
|
||||
$deletemark = request::variable('delmarked', false, false, request::POST);
|
||||
$deleteall = request::variable('delall', false, false, request::POST);
|
||||
$deletemark = phpbb_request::variable('delmarked', false, false, phpbb_request::POST);
|
||||
$deleteall = phpbb_request::variable('delall', false, false, phpbb_request::POST);
|
||||
$marked = request_var('mark', array(0));
|
||||
|
||||
// Sort keys
|
||||
|
|
|
@ -266,7 +266,7 @@ class acp_modules
|
|||
$module_data['module_langname'] = utf8_normalize_nfc(request_var('module_langname', (string) $module_row['module_langname'], true));
|
||||
$module_data['module_mode'] = request_var('module_mode', (string) $module_row['module_mode']);
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
|
|
@ -37,10 +37,10 @@ class acp_permission_roles
|
|||
|
||||
$this->tpl_name = 'acp_permission_roles';
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$role_id = request_var('role_id', 0);
|
||||
$action = request_var('action', '');
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : $action;
|
||||
|
||||
$form_name = 'acp_permissions';
|
||||
add_form_key($form_name);
|
||||
|
|
|
@ -59,7 +59,7 @@ class acp_permissions
|
|||
// Set some vars
|
||||
$action = request_var('action', array('' => 0));
|
||||
$action = key($action);
|
||||
$action = (request::is_set_post('psubmit')) ? 'apply_permissions' : $action;
|
||||
$action = (phpbb_request::is_set_post('psubmit')) ? 'apply_permissions' : $action;
|
||||
|
||||
$all_forums = request_var('all_forums', 0);
|
||||
$subforum_id = request_var('subforum_id', 0);
|
||||
|
@ -229,8 +229,8 @@ class acp_permissions
|
|||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
// All users/groups selected?
|
||||
$all_users = request::is_set_post('all_users');
|
||||
$all_groups = request::is_set_post('all_groups');
|
||||
$all_users = phpbb_request::is_set_post('all_users');
|
||||
$all_groups = phpbb_request::is_set_post('all_groups');
|
||||
|
||||
if ($all_users || $all_groups)
|
||||
{
|
||||
|
@ -257,7 +257,7 @@ class acp_permissions
|
|||
break;
|
||||
|
||||
case 'apply_permissions':
|
||||
if (!request::is_set_post('setting'))
|
||||
if (!phpbb_request::is_set_post('setting'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ class acp_permissions
|
|||
break;
|
||||
|
||||
case 'apply_all_permissions':
|
||||
if (!request::is_set_post('setting'))
|
||||
if (!phpbb_request::is_set_post('setting'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -376,8 +376,8 @@ class acp_permissions
|
|||
case 'usergroup':
|
||||
case 'usergroup_view':
|
||||
|
||||
$all_users = request::is_set_post('all_users');
|
||||
$all_groups = request::is_set_post('all_groups');
|
||||
$all_users = phpbb_request::is_set_post('all_users');
|
||||
$all_groups = phpbb_request::is_set_post('all_groups');
|
||||
|
||||
if ((sizeof($user_id) && !$all_users) || (sizeof($group_id) && !$all_groups))
|
||||
{
|
||||
|
@ -632,14 +632,14 @@ class acp_permissions
|
|||
list($ug_id, ) = each($psubmit);
|
||||
list($forum_id, ) = each($psubmit[$ug_id]);
|
||||
|
||||
$auth_settings = request::variable('setting', array(0 => array(0 => array('' => 0))), false, request::POST);
|
||||
$auth_settings = phpbb_request::variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request::POST);
|
||||
if (!isset($auth_settings[$ug_id][$forum_id]) || !sizeof($auth_settings[$ug_id][$forum_id])))
|
||||
{
|
||||
trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING);
|
||||
}
|
||||
|
||||
// Do we have a role we want to set?
|
||||
$assigned_role = request::variable(array('role', $ug_id, $forum_id), 0, false, request::POST));
|
||||
$assigned_role = phpbb_request::variable(array('role', $ug_id, $forum_id), 0, false, phpbb_request::POST));
|
||||
|
||||
// Do the admin want to set these permissions to other items too?
|
||||
$inherit = request_var('inherit', array(0 => array(0)));
|
||||
|
@ -709,8 +709,8 @@ class acp_permissions
|
|||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$auth_settings = request::variable('setting', array(0 => array(0 => array('' => 0))), false, request::POST);
|
||||
$auth_roles = request::variable('role', array(0 => array(0 => 0)), false, request::POST);
|
||||
$auth_settings = phpbb_request::variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request::POST);
|
||||
$auth_roles = phpbb_request::variable('role', array(0 => array(0 => 0)), false, phpbb_request::POST);
|
||||
$ug_ids = $forum_ids = array();
|
||||
|
||||
// We need to go through the auth settings
|
||||
|
|
|
@ -38,7 +38,7 @@ class acp_profile
|
|||
$this->tpl_name = 'acp_profile';
|
||||
$this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS';
|
||||
|
||||
$action = (request::is_set_post('create')) ? 'create' : request_var('action', '');
|
||||
$action = (phpbb_request::is_set_post('create')) ? 'create' : request_var('action', '');
|
||||
|
||||
$error = array();
|
||||
$s_hidden_fields = '';
|
||||
|
@ -287,8 +287,8 @@ class acp_profile
|
|||
$field_id = request_var('field_id', 0);
|
||||
$step = request_var('step', 1);
|
||||
|
||||
$submit = (request::is_set('next') || request::is_set('prev')) ? true : false;
|
||||
$save = request::is_set('save');
|
||||
$submit = (phpbb_request::is_set('next') || phpbb_request::is_set('prev')) ? true : false;
|
||||
$save = phpbb_request::is_set('save');
|
||||
|
||||
// The language id of default language
|
||||
$this->edit_lang_id = $this->lang_defs['iso'][$config['default_lang']];
|
||||
|
@ -399,7 +399,7 @@ class acp_profile
|
|||
$cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));
|
||||
|
||||
// Field option...
|
||||
if (request::is_set('field_option'))
|
||||
if (phpbb_request::is_set('field_option'))
|
||||
{
|
||||
$field_option = request_var('field_option', '');
|
||||
|
||||
|
@ -463,7 +463,7 @@ class acp_profile
|
|||
}
|
||||
else if ($field_type == FIELD_TEXT && $key == 'field_length')
|
||||
{
|
||||
if (request::is_set('rows'))
|
||||
if (phpbb_request::is_set('rows'))
|
||||
{
|
||||
$cp->vars['rows'] = request_var('rows', 0);
|
||||
$cp->vars['columns'] = request_var('columns', 0);
|
||||
|
@ -492,12 +492,12 @@ class acp_profile
|
|||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('field_default_value', $var, request::REQUEST);
|
||||
request::overwrite('field_default_value', $var, request::POST);
|
||||
phpbb_request::overwrite('field_default_value', $var, phpbb_request::REQUEST);
|
||||
phpbb_request::overwrite('field_default_value', $var, phpbb_request::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (request::is_set('field_default_value_day'))
|
||||
if (phpbb_request::is_set('field_default_value_day'))
|
||||
{
|
||||
$cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
|
||||
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
|
||||
|
@ -506,8 +506,8 @@ class acp_profile
|
|||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('field_default_value', $var, request::REQUEST);
|
||||
request::overwrite('field_default_value', $var, request::POST);
|
||||
phpbb_request::overwrite('field_default_value', $var, phpbb_request::REQUEST);
|
||||
phpbb_request::overwrite('field_default_value', $var, phpbb_request::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -633,7 +633,7 @@ class acp_profile
|
|||
}
|
||||
}
|
||||
|
||||
$step = (request::is_set('next')) ? $step + 1 : ((request::is_set('prev')) ? $step - 1 : $step);
|
||||
$step = (phpbb_request::is_set('next')) ? $step + 1 : ((phpbb_request::is_set('prev')) ? $step - 1 : $step);
|
||||
|
||||
if (sizeof($error))
|
||||
{
|
||||
|
@ -653,7 +653,7 @@ class acp_profile
|
|||
|
||||
foreach ($key_ary as $key)
|
||||
{
|
||||
if ($field_type == FIELD_TEXT && $key == 'field_length' && request::is_set('rows'))
|
||||
if ($field_type == FIELD_TEXT && $key == 'field_length' && phpbb_request::is_set('rows'))
|
||||
{
|
||||
$cp->vars['rows'] = request_var('rows', 0);
|
||||
$cp->vars['columns'] = request_var('columns', 0);
|
||||
|
@ -667,7 +667,7 @@ class acp_profile
|
|||
{
|
||||
$_new_key_ary[$key] = 'now';
|
||||
}
|
||||
else if (request::is_set('field_default_value_day'))
|
||||
else if (phpbb_request::is_set('field_default_value_day'))
|
||||
{
|
||||
$cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
|
||||
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
|
||||
|
@ -675,13 +675,13 @@ class acp_profile
|
|||
$_new_key_ary[$key] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
}
|
||||
}
|
||||
else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && request::is_set('l_lang_options'))
|
||||
else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && phpbb_request::is_set('l_lang_options'))
|
||||
{
|
||||
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!request::is_set($key))
|
||||
if (!phpbb_request::is_set($key))
|
||||
{
|
||||
$var = false;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class acp_prune
|
|||
|
||||
$all_forums = request_var('all_forums', 0);
|
||||
$forum_id = request_var('f', array(0));
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if ($all_forums)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ class acp_prune
|
|||
|
||||
$user->add_lang('memberlist');
|
||||
|
||||
$prune = request::is_set_post('prune');
|
||||
$prune = phpbb_request::is_set_post('prune');
|
||||
|
||||
if ($prune)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,8 @@ class acp_ranks
|
|||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (request::is_set_post('save')) ? 'save' : $action;
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (phpbb_request::is_set_post('save')) ? 'save' : $action;
|
||||
$rank_id = request_var('id', 0);
|
||||
|
||||
$this->tpl_name = 'acp_ranks';
|
||||
|
|
|
@ -31,7 +31,7 @@ class acp_reasons
|
|||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$reason_id = request_var('id', 0);
|
||||
|
||||
$this->tpl_name = 'acp_reasons';
|
||||
|
|
|
@ -52,7 +52,7 @@ class acp_search
|
|||
{
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$search_types = $this->get_search_types();
|
||||
|
||||
|
@ -239,7 +239,7 @@ class acp_search
|
|||
}
|
||||
$this->state = explode(',', $config['search_indexing_state']);
|
||||
|
||||
if (request::is_set_post('cancel'))
|
||||
if (phpbb_request::is_set_post('cancel'))
|
||||
{
|
||||
$action = '';
|
||||
$this->state = array();
|
||||
|
|
|
@ -50,7 +50,7 @@ class acp_styles
|
|||
$this->page_title = 'ACP_CAT_STYLES';
|
||||
|
||||
$action = request_var('action', '');
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : $action;
|
||||
$style_id = request_var('id', 0);
|
||||
|
||||
// Fill the configuration variables
|
||||
|
@ -646,7 +646,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
$template_data = htmlspecialchars_decode($template_data);
|
||||
$template_file = utf8_normalize_nfc(request_var('template_file', '', true));
|
||||
$text_rows = max(5, min(999, request_var('text_rows', 20)));
|
||||
$save_changes = request::is_set_post('save');
|
||||
$save_changes = phpbb_request::is_set_post('save');
|
||||
|
||||
// make sure template_file path doesn't go upwards
|
||||
$template_file = str_replace('..', '.', $template_file);
|
||||
|
@ -805,7 +805,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
|
||||
$source = str_replace('/', '.', request_var('source', ''));
|
||||
$file_ary = array_diff(request_var('delete', array('')), array(''));
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . STYLES_TEMPLATE_TABLE . "
|
||||
|
@ -930,7 +930,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
$theme_data = htmlspecialchars_decode($theme_data);
|
||||
$theme_file = utf8_normalize_nfc(request_var('template_file', '', true));
|
||||
$text_rows = max(5, min(999, request_var('text_rows', 20)));
|
||||
$save_changes = request::is_set_post('save');
|
||||
$save_changes = phpbb_request::is_set_post('save');
|
||||
|
||||
// make sure theme_file path doesn't go upwards
|
||||
$theme_file = str_replace('..', '.', $theme_file);
|
||||
|
@ -1111,7 +1111,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
|
||||
$this->page_title = 'EDIT_IMAGESET';
|
||||
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
$imgname = request_var('imgname', '');
|
||||
$imgpath = request_var('imgpath', '');
|
||||
|
@ -1172,7 +1172,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
}
|
||||
}
|
||||
|
||||
if ($update && request::is_set_post('imgpath'))
|
||||
if ($update && phpbb_request::is_set_post('imgpath'))
|
||||
{
|
||||
if ($valid_name)
|
||||
{
|
||||
|
@ -1379,7 +1379,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
global $db, $template, $user, $cache, $config;
|
||||
|
||||
$new_id = request_var('new_id', 0);
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
$sql_where = '';
|
||||
|
||||
switch ($mode)
|
||||
|
@ -1514,7 +1514,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
{
|
||||
global $db, $template, $user, $cache, $config;
|
||||
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
$inc_template = request_var('inc_template', 0);
|
||||
$inc_theme = request_var('inc_theme', 0);
|
||||
|
@ -1911,7 +1911,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
{
|
||||
global $template, $db, $config, $user, $safe_mode, $cache;
|
||||
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
$l_type = strtoupper($mode);
|
||||
|
||||
$error = array();
|
||||
|
@ -2269,7 +2269,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
$element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
|
||||
|
||||
$install_path = request_var('path', '');
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
// Installing, obtain cfg file contents
|
||||
if ($install_path)
|
||||
|
@ -2432,7 +2432,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
);
|
||||
|
||||
$basis = request_var('basis', 0);
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
if ($basis)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ class acp_users
|
|||
$user_id = request_var('u', 0);
|
||||
$action = request_var('action', '');
|
||||
|
||||
$submit = (request::is_set_post('update') && !request::is_set_post('cancel')) ? true : false;
|
||||
$submit = (phpbb_request::is_set_post('update') && !phpbb_request::is_set_post('cancel')) ? true : false;
|
||||
|
||||
$form_name = 'acp_users';
|
||||
add_form_key($form_name);
|
||||
|
@ -937,8 +937,8 @@ class acp_users
|
|||
|
||||
// Set up general vars
|
||||
$start = request_var('start', 0);
|
||||
$deletemark = request::is_set_post('delmarked');
|
||||
$deleteall = request::is_set_post('delall');
|
||||
$deletemark = phpbb_request::is_set_post('delmarked');
|
||||
$deleteall = phpbb_request::is_set_post('delall');
|
||||
$marked = request_var('mark', array(0));
|
||||
$message = utf8_normalize_nfc(request_var('message', '', true));
|
||||
|
||||
|
@ -1474,7 +1474,7 @@ class acp_users
|
|||
// Generate users avatar
|
||||
$avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
|
||||
|
||||
$display_gallery = request::is_set_post('display_gallery');
|
||||
$display_gallery = phpbb_request::is_set_post('display_gallery');
|
||||
$avatar_select = basename(request_var('avatar_select', ''));
|
||||
$category = basename(request_var('category', ''));
|
||||
|
||||
|
@ -1551,7 +1551,7 @@ class acp_users
|
|||
$enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
|
||||
$signature = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true));
|
||||
|
||||
$preview = request::is_set_post('preview');
|
||||
$preview = phpbb_request::is_set_post('preview');
|
||||
|
||||
if ($submit || $preview)
|
||||
{
|
||||
|
@ -1636,7 +1636,7 @@ class acp_users
|
|||
case 'attach':
|
||||
|
||||
$start = request_var('start', 0);
|
||||
$deletemark = request::is_set_post('delmarked');
|
||||
$deletemark = phpbb_request::is_set_post('delmarked');
|
||||
$marked = request_var('mark', array(0));
|
||||
|
||||
// Sort keys
|
||||
|
|
|
@ -32,7 +32,7 @@ class acp_words
|
|||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$action = (request::is_set_post('add')) ? 'add' : ((request::is_set_post('save')) ? 'save' : $action);
|
||||
$action = (phpbb_request::is_set_post('add')) ? 'add' : ((phpbb_request::is_set_post('save')) ? 'save' : $action);
|
||||
|
||||
$s_hidden_fields = '';
|
||||
$word_info = array();
|
||||
|
|
|
@ -32,8 +32,8 @@ class mcp_ban
|
|||
// Include the admin banning interface...
|
||||
include(PHPBB_ROOT_PATH . 'includes/acp/acp_ban.' . PHP_EXT);
|
||||
|
||||
$bansubmit = request::is_set_post('bansubmit');
|
||||
$unbansubmit = request::is_set_post('unbansubmit');
|
||||
$bansubmit = phpbb_request::is_set_post('bansubmit');
|
||||
$unbansubmit = phpbb_request::is_set_post('unbansubmit');
|
||||
$current_time = time();
|
||||
|
||||
$user->add_lang(array('acp/ban', 'acp/users'));
|
||||
|
|
|
@ -33,10 +33,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
|||
if ($merge_select)
|
||||
{
|
||||
// Fixes a "bug" that makes forum_view use the same ordering as topic_view
|
||||
request::overwrite('sk', null, request::POST);
|
||||
request::overwrite('sd', null, request::POST);
|
||||
request::overwrite('sk', null, request::REQUEST);
|
||||
request::overwrite('sd', null, request::REQUEST);
|
||||
phpbb_request::overwrite('sk', null, phpbb_request::POST);
|
||||
phpbb_request::overwrite('sd', null, phpbb_request::POST);
|
||||
phpbb_request::overwrite('sk', null, phpbb_request::REQUEST);
|
||||
phpbb_request::overwrite('sd', null, phpbb_request::REQUEST);
|
||||
}
|
||||
|
||||
$forum_id = $forum_info['forum_id'];
|
||||
|
|
|
@ -576,7 +576,7 @@ function mcp_move_topic($topic_ids)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (request::is_set_post('confirm'))
|
||||
else if (phpbb_request::is_set_post('confirm'))
|
||||
{
|
||||
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ function mcp_move_topic($topic_ids)
|
|||
if ($to_forum_id && !$additional_msg && confirm_box(true))
|
||||
{
|
||||
$topic_data = get_topic_data($topic_ids);
|
||||
$leave_shadow = request::is_set_post('move_leave_shadow');
|
||||
$leave_shadow = phpbb_request::is_set_post('move_leave_shadow');
|
||||
|
||||
$topics_moved = sizeof($topic_ids);
|
||||
$topics_authed_moved = 0;
|
||||
|
@ -783,7 +783,7 @@ function mcp_delete_topic($topic_ids)
|
|||
confirm_box(false, (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS', $s_hidden_fields);
|
||||
}
|
||||
|
||||
if (!request::is_set('quickmod'))
|
||||
if (!phpbb_request::is_set('quickmod'))
|
||||
{
|
||||
$redirect = request_var('redirect', 'index.' . PHP_EXT);
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
@ -976,7 +976,7 @@ function mcp_fork_topic($topic_ids)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (request::is_set_post('confirm'))
|
||||
else if (phpbb_request::is_set_post('confirm'))
|
||||
{
|
||||
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
|
||||
}
|
||||
|
|
|
@ -484,7 +484,7 @@ function approve_post($post_id_list, $id, $mode)
|
|||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
$notify_poster = request::is_set('notify_poster');
|
||||
$notify_poster = phpbb_request::is_set('notify_poster');
|
||||
|
||||
// If Topic -> total_topics = total_topics+1, total_posts = total_posts+1, forum_topics = forum_topics+1, forum_posts = forum_posts+1
|
||||
// If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1
|
||||
|
@ -807,7 +807,7 @@ function disapprove_post($post_id_list, $id, $mode)
|
|||
'redirect' => $redirect)
|
||||
);
|
||||
|
||||
$notify_poster = request::is_set('notify_poster');
|
||||
$notify_poster = phpbb_request::is_set('notify_poster');
|
||||
$disapprove_reason = '';
|
||||
|
||||
if ($reason_id)
|
||||
|
|
|
@ -45,7 +45,7 @@ function mcp_topic_view($id, $mode, $action)
|
|||
$forum_id = request_var('f', 0);
|
||||
$to_topic_id = request_var('to_topic_id', 0);
|
||||
$to_forum_id = request_var('to_forum_id', 0);
|
||||
$sort = request::is_set_post('sort');
|
||||
$sort = phpbb_request::is_set_post('sort');
|
||||
$submitted_id_list = request_var('post_ids', array(0));
|
||||
$checked_ids = $post_id_list = request_var('post_id_list', array(0));
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ class mcp_warn
|
|||
|
||||
$post_id = request_var('p', 0);
|
||||
$forum_id = request_var('f', 0);
|
||||
$notify = request::is_set('notify_user');
|
||||
$notify = phpbb_request::is_set('notify_user');
|
||||
$warning = utf8_normalize_nfc(request_var('warning', '', true));
|
||||
|
||||
$sql = 'SELECT u.*, p.*
|
||||
|
@ -337,7 +337,7 @@ class mcp_warn
|
|||
|
||||
$user_id = request_var('u', 0);
|
||||
$username = request_var('username', '', true);
|
||||
$notify = request::is_set('notify_user');
|
||||
$notify = phpbb_request::is_set('notify_user');
|
||||
$warning = utf8_normalize_nfc(request_var('warning', '', true));
|
||||
|
||||
$sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
|
||||
|
|
|
@ -33,8 +33,8 @@ class ucp_attachments
|
|||
$sort_key = request_var('sk', 'a');
|
||||
$sort_dir = request_var('sd', 'a');
|
||||
|
||||
$delete = request::is_set_post('delete');
|
||||
$confirm = request::is_set_post('confirm');
|
||||
$delete = phpbb_request::is_set_post('delete');
|
||||
$confirm = phpbb_request::is_set_post('confirm');
|
||||
$delete_ids = array_keys(request_var('attachment', array(0)));
|
||||
|
||||
if ($delete && sizeof($delete_ids))
|
||||
|
|
|
@ -33,8 +33,8 @@ class ucp_groups
|
|||
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
|
||||
$mark_ary = request_var('mark', array(0));
|
||||
$submit = request::variable('submit', false, false, request::POST);
|
||||
$delete = request::variable('delete', false, false, request::POST);
|
||||
$submit = phpbb_request::variable('submit', false, false, phpbb_request::POST);
|
||||
$delete = phpbb_request::variable('delete', false, false, phpbb_request::POST);
|
||||
$error = $data = array();
|
||||
|
||||
switch ($mode)
|
||||
|
@ -43,9 +43,9 @@ class ucp_groups
|
|||
|
||||
$this->page_title = 'UCP_USERGROUPS_MEMBER';
|
||||
|
||||
if ($submit || request::is_set_post('change_default'))
|
||||
if ($submit || phpbb_request::is_set_post('change_default'))
|
||||
{
|
||||
$action = (request::is_set_post('change_default')) ? 'change_default' : request_var('action', '');
|
||||
$action = (phpbb_request::is_set_post('change_default')) ? 'change_default' : request_var('action', '');
|
||||
$group_id = ($action == 'change_default') ? request_var('default', 0) : request_var('selected', 0);
|
||||
|
||||
if (!$group_id)
|
||||
|
@ -407,7 +407,7 @@ class ucp_groups
|
|||
case 'manage':
|
||||
|
||||
$this->page_title = 'UCP_USERGROUPS_MANAGE';
|
||||
$action = (request::is_set_post('addusers')) ? 'addusers' : request_var('action', '');
|
||||
$action = (phpbb_request::is_set_post('addusers')) ? 'addusers' : request_var('action', '');
|
||||
$group_id = request_var('g', 0);
|
||||
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
|
||||
|
@ -478,7 +478,7 @@ class ucp_groups
|
|||
|
||||
$data = $submit_ary = array();
|
||||
|
||||
$update = request::is_set_post('update');
|
||||
$update = phpbb_request::is_set_post('update');
|
||||
|
||||
$error = array();
|
||||
|
||||
|
@ -501,7 +501,7 @@ class ucp_groups
|
|||
$submit_ary = array(
|
||||
'colour' => request_var('group_colour', ''),
|
||||
'rank' => request_var('group_rank', 0),
|
||||
'receive_pm' => request::is_set('group_receive_pm') ? 1 : 0,
|
||||
'receive_pm' => phpbb_request::is_set('group_receive_pm') ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients'=> request_var('group_max_recipients', 0),
|
||||
);
|
||||
|
@ -668,7 +668,7 @@ class ucp_groups
|
|||
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
|
||||
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
|
||||
|
||||
$display_gallery = request::is_set_post('display_gallery');
|
||||
$display_gallery = phpbb_request::is_set_post('display_gallery');
|
||||
|
||||
if ($config['allow_avatar_local'] && $display_gallery)
|
||||
{
|
||||
|
|
|
@ -204,7 +204,7 @@ class ucp_main
|
|||
|
||||
add_form_key('ucp_front_subscribed');
|
||||
|
||||
$unwatch = request::is_set_post('unwatch');
|
||||
$unwatch = phpbb_request::is_set_post('unwatch');
|
||||
|
||||
if ($unwatch)
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ class ucp_main
|
|||
}
|
||||
else
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
|
@ -387,10 +387,10 @@ class ucp_main
|
|||
|
||||
$user->add_lang('viewforum');
|
||||
|
||||
if (request::is_set_post('unbookmark'))
|
||||
if (phpbb_request::is_set_post('unbookmark'))
|
||||
{
|
||||
$s_hidden_fields = array('unbookmark' => 1);
|
||||
$topics = array_keys(request::variable('t', array(0 => 0), false, request::POST));
|
||||
$topics = array_keys(phpbb_request::variable('t', array(0 => 0), false, phpbb_request::POST));
|
||||
$url = $this->u_action;
|
||||
|
||||
if (!sizeof($topics))
|
||||
|
@ -433,10 +433,10 @@ class ucp_main
|
|||
|
||||
$user->add_lang('posting');
|
||||
|
||||
$edit = request::is_set('edit');
|
||||
$draft_id = request::variable('edit', 0);
|
||||
$submit = request::is_set_post('submit');
|
||||
$delete = request::is_set_post('delete');
|
||||
$edit = phpbb_request::is_set('edit');
|
||||
$draft_id = phpbb_request::variable('edit', 0);
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$delete = phpbb_request::is_set_post('delete');
|
||||
|
||||
$s_hidden_fields = ($edit) ? '<input type="hidden" name="edit" value="' . $draft_id . '" />' : '';
|
||||
$draft_subject = $draft_message = '';
|
||||
|
@ -615,7 +615,7 @@ class ucp_main
|
|||
$template->assign_vars(array(
|
||||
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
|
||||
|
||||
'S_DISPLAY_MARK_ALL' => ($mode == 'watched' || ($mode == 'drafts' && !request::is_set('edit', request::GET))) ? true : false,
|
||||
'S_DISPLAY_MARK_ALL' => ($mode == 'watched' || ($mode == 'drafts' && !phpbb_request::is_set('edit', phpbb_request::GET))) ? true : false,
|
||||
'S_HIDDEN_FIELDS' => (isset($s_hidden_fields)) ? $s_hidden_fields : '',
|
||||
'S_UCP_ACTION' => $this->u_action,
|
||||
|
||||
|
|
|
@ -195,8 +195,8 @@ class ucp_pm
|
|||
|
||||
|
||||
// First Handle Mark actions and moving messages
|
||||
$submit_mark = request::is_set_post('submit_mark');
|
||||
$move_pm = request::is_set_post('move_pm');
|
||||
$submit_mark = phpbb_request::is_set_post('submit_mark');
|
||||
$move_pm = phpbb_request::is_set_post('move_pm');
|
||||
$mark_option = request_var('mark_option', '');
|
||||
$dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX);
|
||||
|
||||
|
@ -211,7 +211,7 @@ class ucp_pm
|
|||
// Move PM
|
||||
if ($move_pm)
|
||||
{
|
||||
$move_msg_ids = request::variable('marked_msg_id', array(0), false, request::POST);
|
||||
$move_msg_ids = phpbb_request::variable('marked_msg_id', array(0), false, phpbb_request::POST);
|
||||
$cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
|
||||
|
||||
if (move_pm($user->data['user_id'], $user->data['message_limit'], $move_msg_ids, $dest_folder, $cur_folder_id))
|
||||
|
|
|
@ -46,19 +46,19 @@ function compose_pm($id, $mode, $action)
|
|||
$lastclick = request_var('lastclick', 0);
|
||||
$address_list = request_var('address_list', array('' => array(0 => '')));
|
||||
|
||||
$submit = request::is_set_post('post');
|
||||
$preview = request::is_set_post('preview');
|
||||
$save = request::is_set_post('save');
|
||||
$load = request::is_set_post('load');
|
||||
$cancel = (request::is_set_post('cancel') && !$save) ? true : false;
|
||||
$delete = request::is_set_post('delete');
|
||||
$submit = phpbb_request::is_set_post('post');
|
||||
$preview = phpbb_request::is_set_post('preview');
|
||||
$save = phpbb_request::is_set_post('save');
|
||||
$load = phpbb_request::is_set_post('load');
|
||||
$cancel = (phpbb_request::is_set_post('cancel') && !$save) ? true : false;
|
||||
$delete = phpbb_request::is_set_post('delete');
|
||||
|
||||
$remove_u = request::is_set('remove_u');
|
||||
$remove_g = request::is_set('remove_g');
|
||||
$add_to = request::is_set('add_to');
|
||||
$add_bcc = request::is_set('add_bcc');
|
||||
$remove_u = phpbb_request::is_set('remove_u');
|
||||
$remove_g = phpbb_request::is_set('remove_g');
|
||||
$add_to = phpbb_request::is_set('add_to');
|
||||
$add_bcc = phpbb_request::is_set('add_bcc');
|
||||
|
||||
$refresh = request::is_set_post('add_file') || request::is_set_post('delete_file') || $save || $load
|
||||
$refresh = phpbb_request::is_set_post('add_file') || phpbb_request::is_set_post('delete_file') || $save || $load
|
||||
|| $remove_u || $remove_g || $add_to || $add_bcc;
|
||||
|
||||
$action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action;
|
||||
|
@ -637,10 +637,10 @@ function compose_pm($id, $mode, $action)
|
|||
|
||||
$icon_id = request_var('icon', 0);
|
||||
|
||||
$enable_bbcode = (!$bbcode_status || request::is_set_post('disable_bbcode')) ? false : true;
|
||||
$enable_smilies = (!$smilies_status || request::is_set_post'disable_smilies')) ? false : true;
|
||||
$enable_urls = (request::is_set_post('disable_magic_url')) ? 0 : 1;
|
||||
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : request::is_set_post('attach_sig');
|
||||
$enable_bbcode = (!$bbcode_status || phpbb_request::is_set_post('disable_bbcode')) ? false : true;
|
||||
$enable_smilies = (!$smilies_status || phpbb_request::is_set_post'disable_smilies')) ? false : true;
|
||||
$enable_urls = (phpbb_request::is_set_post('disable_magic_url')) ? 0 : 1;
|
||||
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : phpbb_request::is_set_post('attach_sig');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
@ -1014,7 +1014,7 @@ function compose_pm($id, $mode, $action)
|
|||
|
||||
$s_hidden_fields = '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
|
||||
$s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : '';
|
||||
$s_hidden_fields .= ($draft_id || request::is_set('draft_loaded')) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', (int) $draft_id) . '" />' : '';
|
||||
$s_hidden_fields .= ($draft_id || phpbb_request::is_set('draft_loaded')) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', (int) $draft_id) . '" />' : '';
|
||||
|
||||
$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_pm_attach'] || !$auth->acl_get('u_pm_attach')) ? '' : ' enctype="multipart/form-data"';
|
||||
|
||||
|
@ -1059,7 +1059,7 @@ function compose_pm($id, $mode, $action)
|
|||
'S_HIDDEN_ADDRESS_FIELD' => $s_hidden_address_field,
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
|
||||
'S_CLOSE_PROGRESS_WINDOW' => request::is_set_post('add_file'),
|
||||
'S_CLOSE_PROGRESS_WINDOW' => phpbb_request::is_set_post('add_file'),
|
||||
'U_PROGRESS_BAR' => append_sid('posting', 'f=0&mode=popup'),
|
||||
'UA_PROGRESS_BAR' => addslashes(append_sid('posting', 'f=0&mode=popup')),
|
||||
));
|
||||
|
|
|
@ -27,7 +27,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
|
||||
add_form_key('ucp_pm_options');
|
||||
// Change "full folder" setting - what to do if folder is full
|
||||
if (request::is_set_post('fullfolder'))
|
||||
if (phpbb_request::is_set_post('fullfolder'))
|
||||
{
|
||||
check_form_key('ucp_pm_options', $config['form_token_lifetime'], $redirect_url);
|
||||
$full_action = request_var('full_action', 0);
|
||||
|
@ -68,7 +68,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
}
|
||||
|
||||
// Add Folder
|
||||
if (request::is_set_post('addfolder'))
|
||||
if (phpbb_request::is_set_post('addfolder'))
|
||||
{
|
||||
if (check_form_key('ucp_pm_options'))
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
}
|
||||
|
||||
// Rename folder
|
||||
if (request::is_set_post('rename_folder'))
|
||||
if (phpbb_request::is_set_post('rename_folder'))
|
||||
{
|
||||
if (check_form_key('ucp_pm_options'))
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
}
|
||||
|
||||
// Remove Folder
|
||||
if (request::is_set_post('remove_folder'))
|
||||
if (phpbb_request::is_set_post('remove_folder'))
|
||||
{
|
||||
$remove_folder_id = request_var('remove_folder_id', 0);
|
||||
|
||||
|
@ -276,7 +276,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
}
|
||||
|
||||
// Add Rule
|
||||
if (request::is_set_post('add_rule'))
|
||||
if (phpbb_request::is_set_post('add_rule'))
|
||||
{
|
||||
if (check_form_key('ucp_pm_options'))
|
||||
{
|
||||
|
@ -345,7 +345,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
}
|
||||
|
||||
// Remove Rule
|
||||
if (request::is_set_post('delete_rule') && !request::is_set_post('cancel'))
|
||||
if (phpbb_request::is_set_post('delete_rule') && !phpbb_request::is_set_post('cancel'))
|
||||
{
|
||||
$delete_id = array_keys(request_var('delete_rule', array(0 => 0)));
|
||||
$delete_id = (!empty($delete_id[0])) ? $delete_id[0] : 0;
|
||||
|
|
|
@ -24,7 +24,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
|||
{
|
||||
global $user, $template, $auth, $db, $cache, $config;
|
||||
|
||||
$submit_export = request::is_set_post('submit_export');
|
||||
$submit_export = phpbb_request::is_set_post('submit_export');
|
||||
|
||||
$folder_info = get_pm_from($folder_id, $folder, $user->data['user_id']);
|
||||
|
||||
|
@ -473,7 +473,7 @@ function get_pm_from($folder_id, $folder, $user_id)
|
|||
{
|
||||
$min_post_time = time() - ($sort_days * 86400);
|
||||
|
||||
if (request::is_set_post('sort'))
|
||||
if (phpbb_request::is_set_post('sort'))
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class ucp_prefs
|
|||
{
|
||||
global $config, $db, $user, $auth, $template;
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$error = $data = array();
|
||||
$s_hidden_fields = '';
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ class ucp_profile
|
|||
|
||||
$user->add_lang('posting');
|
||||
|
||||
$preview = request::variable('preview', false, false, request::POST);
|
||||
$submit = request::variable('submit', false, false, request::POST);
|
||||
$delete = request::variable('delete', false, false, request::POST);
|
||||
$preview = phpbb_request::variable('preview', false, false, phpbb_request::POST);
|
||||
$submit = phpbb_request::variable('submit', false, false, phpbb_request::POST);
|
||||
$delete = phpbb_request::variable('delete', false, false, phpbb_request::POST);
|
||||
$error = $data = array();
|
||||
$s_hidden_fields = '';
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ class ucp_register
|
|||
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
|
||||
|
||||
$coppa = request::is_set('coppa') ? ((request_var('coppa', false)) ? 1 : 0) : false;
|
||||
$agreed = request::variable('agreed', false, false, request::POST) ? 1 : 0;
|
||||
$submit = request::is_set_post('submit');
|
||||
$coppa = phpbb_request::is_set('coppa') ? ((request_var('coppa', false)) ? 1 : 0) : false;
|
||||
$agreed = phpbb_request::variable('agreed', false, false, phpbb_request::POST) ? 1 : 0;
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
$change_lang = request_var('change_lang', '');
|
||||
$user_lang = request_var('lang', $user->lang_name);
|
||||
|
||||
|
@ -71,7 +71,7 @@ class ucp_register
|
|||
$submit = false;
|
||||
|
||||
// Setting back agreed to let the user view the agreement in his/her language
|
||||
$agreed = (request::is_set_post('change_lang')) ? 0 : $agreed;
|
||||
$agreed = (phpbb_request::is_set_post('change_lang')) ? 0 : $agreed;
|
||||
}
|
||||
|
||||
$user->lang_name = $lang = $use_lang;
|
||||
|
|
|
@ -31,7 +31,7 @@ class ucp_remind
|
|||
|
||||
$username = request_var('username', '', true);
|
||||
$email = strtolower(request_var('email', ''));
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ class ucp_resend
|
|||
|
||||
$username = request_var('username', '', true);
|
||||
$email = strtolower(request_var('email', ''));
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
add_form_key('ucp_resend');
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class ucp_zebra
|
|||
{
|
||||
global $config, $db, $user, $auth, $template;
|
||||
|
||||
$submit = request::is_set_post('submit') || request::is_set('add', request::GET) || request::is_set('remove', request::GET);
|
||||
$submit = phpbb_request::is_set_post('submit') || phpbb_request::is_set('add', phpbb_request::GET) || phpbb_request::is_set('remove', phpbb_request::GET);
|
||||
$s_hidden_fields = '';
|
||||
|
||||
$l_mode = strtoupper($mode);
|
||||
|
|
|
@ -32,14 +32,14 @@ $forum_id = request_var('f', 0);
|
|||
$draft_id = request_var('d', 0);
|
||||
$lastclick = request_var('lastclick', 0);
|
||||
|
||||
$submit = request::is_set_post('post');
|
||||
$preview = request::is_set_post('preview');
|
||||
$save = request::is_set_post('save');
|
||||
$load = request::is_set_post('load');
|
||||
$delete = request::is_set_post('delete');
|
||||
$cancel = (request::is_set_post('cancel') && !request::is_set_post('save')) ? true : false;
|
||||
$submit = phpbb_request::is_set_post('post');
|
||||
$preview = phpbb_request::is_set_post('preview');
|
||||
$save = phpbb_request::is_set_post('save');
|
||||
$load = phpbb_request::is_set_post('load');
|
||||
$delete = phpbb_request::is_set_post('delete');
|
||||
$cancel = (phpbb_request::is_set_post('cancel') && !phpbb_request::is_set_post('save')) ? true : false;
|
||||
|
||||
$refresh = (request::is_set_post('add_file') || request::is_set_post('delete_file') || request::is_set_post('cancel_unglobalise') || $save || $load) ? true : false;
|
||||
$refresh = (phpbb_request::is_set_post('add_file') || phpbb_request::is_set_post('delete_file') || phpbb_request::is_set_post('cancel_unglobalise') || $save || $load) ? true : false;
|
||||
$mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
|
||||
|
||||
$error = $post_data = array();
|
||||
|
@ -588,23 +588,23 @@ if ($submit || $preview || $refresh)
|
|||
$post_data['topic_time_limit'] = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
|
||||
$post_data['icon_id'] = request_var('icon', 0);
|
||||
|
||||
$post_data['enable_bbcode'] = (!$bbcode_status || request::is_set_post('disable_bbcode')) ? false : true;
|
||||
$post_data['enable_smilies'] = (!$smilies_status || request::is_set_post('disable_smilies')) ? false : true;
|
||||
$post_data['enable_urls'] = request::is_set_post('disable_magic_url');
|
||||
$post_data['enable_sig'] = (!$config['allow_sig'] || !$auth->acl_get('f_sigs', $forum_id) || !$auth->acl_get('u_sig')) ? false : ((request::is_set_post('attach_sig') && $user->data['is_registered']) ? true : false);
|
||||
$post_data['enable_bbcode'] = (!$bbcode_status || phpbb_request::is_set_post('disable_bbcode')) ? false : true;
|
||||
$post_data['enable_smilies'] = (!$smilies_status || phpbb_request::is_set_post('disable_smilies')) ? false : true;
|
||||
$post_data['enable_urls'] = phpbb_request::is_set_post('disable_magic_url');
|
||||
$post_data['enable_sig'] = (!$config['allow_sig'] || !$auth->acl_get('f_sigs', $forum_id) || !$auth->acl_get('u_sig')) ? false : ((phpbb_request::is_set_post('attach_sig') && $user->data['is_registered']) ? true : false);
|
||||
|
||||
if ($config['allow_topic_notify'] && $user->data['is_registered'])
|
||||
{
|
||||
$notify = request::is_set_post('notify');
|
||||
$notify = phpbb_request::is_set_post('notify');
|
||||
}
|
||||
else
|
||||
{
|
||||
$notify = false;
|
||||
}
|
||||
|
||||
$topic_lock = request::is_set_post('lock_topic');
|
||||
$post_lock = request::is_set_post('lock_post');
|
||||
$poll_delete = request::is_set_post('poll_delete');
|
||||
$topic_lock = phpbb_request::is_set_post('lock_topic');
|
||||
$post_lock = phpbb_request::is_set_post('lock_post');
|
||||
$poll_delete = phpbb_request::is_set_post('poll_delete');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
@ -654,7 +654,7 @@ if ($submit || $preview || $refresh)
|
|||
$post_data['poll_length'] = request_var('poll_length', 0);
|
||||
$post_data['poll_option_text'] = utf8_normalize_nfc(request_var('poll_option_text', '', true));
|
||||
$post_data['poll_max_options'] = request_var('poll_max_options', 1);
|
||||
$post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && request::is_set_post('poll_vote_change')) ? 1 : 0;
|
||||
$post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && phpbb_request::is_set_post('poll_vote_change')) ? 1 : 0;
|
||||
}
|
||||
|
||||
// If replying/quoting and last post id has changed
|
||||
|
@ -1230,7 +1230,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c
|
|||
|
||||
$s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $post_data['topic_last_post_id'] . '" />' : '';
|
||||
$s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
|
||||
$s_hidden_fields .= ($draft_id || request::is_set('draft_loaded')) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
|
||||
$s_hidden_fields .= ($draft_id || phpbb_request::is_set('draft_loaded')) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
|
||||
|
||||
// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
|
||||
if ($solved_captcha !== false)
|
||||
|
@ -1271,7 +1271,7 @@ $template->assign_vars(array(
|
|||
'UA_PROGRESS_BAR' => addslashes(append_sid('posting', "f=$forum_id&mode=popup")),
|
||||
|
||||
'S_PRIVMSGS' => false,
|
||||
'S_CLOSE_PROGRESS_WINDOW' => request::is_set_post('add_file'),
|
||||
'S_CLOSE_PROGRESS_WINDOW' => phpbb_request::is_set_post('add_file'),
|
||||
'S_EDIT_POST' => ($mode == 'edit') ? true : false,
|
||||
'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false,
|
||||
'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false,
|
||||
|
|
|
@ -28,7 +28,7 @@ $reason_id = request_var('reason_id', 0);
|
|||
$report_text = utf8_normalize_nfc(request_var('report_text', '', true));
|
||||
$user_notify = ($user->data['is_registered']) ? request_var('notify', 0) : false;
|
||||
|
||||
$submit = request::is_set_post('submit');
|
||||
$submit = phpbb_request::is_set_post('submit');
|
||||
|
||||
if (!$post_id)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ if (!$post_id)
|
|||
$redirect_url = append_sid('viewtopic', "f=$forum_id&p=$post_id") . "#p$post_id";
|
||||
|
||||
// Has the report been cancelled?
|
||||
if (request::is_set_post('cancel'))
|
||||
if (phpbb_request::is_set_post('cancel'))
|
||||
{
|
||||
redirect($redirect_url);
|
||||
}
|
||||
|
|
|
@ -562,7 +562,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
|||
|
||||
if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ switch ($mode)
|
|||
break;
|
||||
|
||||
case 'register':
|
||||
if ($user->data['is_registered'] || request::is_set('not_agreed'))
|
||||
if ($user->data['is_registered'] || phpbb_request::is_set('not_agreed'))
|
||||
{
|
||||
redirect(append_sid('index'));
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ switch ($mode)
|
|||
break;
|
||||
|
||||
case 'logout':
|
||||
if ($user->data['user_id'] != ANONYMOUS && request::variable('sid', '', false, request::GET) === $user->session_id)
|
||||
if ($user->data['user_id'] != ANONYMOUS && phpbb_request::variable('sid', '', false, phpbb_request::GET) === $user->session_id)
|
||||
{
|
||||
$user->session_kill();
|
||||
$user->session_begin();
|
||||
|
@ -140,7 +140,7 @@ switch ($mode)
|
|||
{
|
||||
$set_time = time() - 31536000;
|
||||
|
||||
$cookies = request::variable_names(request::COOKIE);
|
||||
$cookies = phpbb_request::variable_names(phpbb_request::COOKIE);
|
||||
foreach ($cookies as $cookie_name)
|
||||
{
|
||||
$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
|
||||
|
|
|
@ -75,7 +75,7 @@ if (!$forum_data)
|
|||
$user->setup('viewforum', $forum_data['forum_style']);
|
||||
|
||||
// Redirect to login upon emailed notification links
|
||||
if (request::is_set('e', request::GET) && !$user->data['is_registered'])
|
||||
if (phpbb_request::is_set('e', phpbb_request::GET) && !$user->data['is_registered'])
|
||||
{
|
||||
login_box('', $user->lang['LOGIN_NOTIFY_FORUM']);
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ if ($sort_days)
|
|||
$topics_count = (int) $db->sql_fetchfield('num_topics');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (request::is_set_post('sort'))
|
||||
if (phpbb_request::is_set_post('sort'))
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ if ($topic_data['forum_password'])
|
|||
}
|
||||
|
||||
// Redirect to login or to the correct post upon emailed notification links
|
||||
if (request::is_set('e', request::GET))
|
||||
if (phpbb_request::is_set('e', phpbb_request::GET))
|
||||
{
|
||||
$jump_to = request_var('e', 0);
|
||||
|
||||
|
@ -417,7 +417,7 @@ if ($sort_days)
|
|||
|
||||
$limit_posts_time = "AND p.post_time >= $min_post_time ";
|
||||
|
||||
if (request::is_set_post('sort'))
|
||||
if (phpbb_request::is_set_post('sort'))
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ if (!empty($topic_data['poll_start']))
|
|||
// Cookie based guest tracking ... I don't like this but hum ho
|
||||
// it's oft requested. This relies on "nice" users who don't feel
|
||||
// the need to delete cookies to mess with results.
|
||||
$cur_voted_list = request::variable($config['cookie_name'] . '_poll_' . $topic_id, '', false, request::COOKIE);
|
||||
$cur_voted_list = phpbb_request::variable($config['cookie_name'] . '_poll_' . $topic_id, '', false, phpbb_request::COOKIE);
|
||||
if (!empty($cur_voted_list))
|
||||
{
|
||||
$cur_voted_id = array_map('intval', explode(',', $cur_voted_list));
|
||||
|
@ -1586,9 +1586,9 @@ else if (!$all_marked_read)
|
|||
// We overwrite the 'f' request variable if there is no forum specified
|
||||
// to be able to display the correct online list.
|
||||
// One downside is that the user currently viewing this topic/post is not taken into account.
|
||||
if (empty(request::variable('f', '')))
|
||||
if (empty(phpbb_request::variable('f', '')))
|
||||
{
|
||||
request::overwrite('f', $forum_id);
|
||||
phpbb_request::overwrite('f', $forum_id);
|
||||
}
|
||||
|
||||
// Output the page
|
||||
|
|
Loading…
Add table
Reference in a new issue