mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01: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
@ -136,7 +136,7 @@ function adm_page_header($page_title)
|
||||
'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
@ -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');
|
||||
}
|
||||
@ -307,7 +307,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
|
||||
case 'select':
|
||||
case 'custom':
|
||||
|
||||
|
||||
$return = '';
|
||||
|
||||
if (isset($vars['method']))
|
||||
@ -346,7 +346,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
{
|
||||
$args = array($new[$config_key], $key);
|
||||
}
|
||||
|
||||
|
||||
$return = call_user_func_array($call, $args);
|
||||
|
||||
if ($tpl_type[0] == 'select')
|
||||
@ -383,19 +383,19 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
$type = 0;
|
||||
$min = 1;
|
||||
$max = 2;
|
||||
|
||||
|
||||
foreach ($config_vars as $config_name => $config_definition)
|
||||
{
|
||||
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config_definition['validate']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$validator = explode(':', $config_definition['validate']);
|
||||
|
||||
// Validate a bit. ;) (0 = type, 1 = min, 2= max)
|
||||
@ -554,14 +554,14 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
function validate_range($value_ary, &$error)
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
$column_types = array(
|
||||
'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
|
||||
'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
|
||||
'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff),
|
||||
'INT' => array('php_type' => 'int', 'min' => (int) 0x80000000, 'max' => (int) 0x7fffffff),
|
||||
'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127),
|
||||
|
||||
|
||||
'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255),
|
||||
);
|
||||
foreach ($value_ary as $value)
|
||||
@ -588,7 +588,7 @@ function validate_range($value_ary, &$error)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'int':
|
||||
case 'int':
|
||||
$min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min'];
|
||||
$max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
|
||||
if ($value['value'] < $min)
|
||||
|
@ -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))
|
||||
{
|
||||
@ -1348,7 +1348,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . '
|
||||
AND ug.user_pending = 0
|
||||
AND u.user_id = ug.user_id
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
|
||||
$sql_allow_pm;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
@ -106,7 +106,7 @@ class custom_profile
|
||||
{
|
||||
case FIELD_DATE:
|
||||
$field_validate = explode('-', $field_value);
|
||||
|
||||
|
||||
$day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
|
||||
$month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
|
||||
$year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
|
||||
@ -154,14 +154,14 @@ class custom_profile
|
||||
return 'FIELD_TOO_LARGE';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_DROPDOWN:
|
||||
if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
|
||||
{
|
||||
return 'FIELD_REQUIRED';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_STRING:
|
||||
case FIELD_TEXT:
|
||||
if (empty($field_value) && !$field_data['field_required'])
|
||||
@ -205,7 +205,7 @@ class custom_profile
|
||||
global $db, $user, $auth;
|
||||
|
||||
$this->profile_cache = array();
|
||||
|
||||
|
||||
// Display hidden/no_view fields for admin/moderator
|
||||
$sql = 'SELECT l.*, f.*
|
||||
FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
|
||||
@ -318,12 +318,12 @@ class custom_profile
|
||||
case 'FIELD_TOO_SMALL':
|
||||
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']);
|
||||
break;
|
||||
|
||||
|
||||
case 'FIELD_TOO_LONG':
|
||||
case 'FIELD_TOO_LARGE':
|
||||
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']);
|
||||
break;
|
||||
|
||||
|
||||
case 'FIELD_INVALID_CHARS':
|
||||
switch ($row['field_validation'])
|
||||
{
|
||||
@ -341,7 +341,7 @@ class custom_profile
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($error != '')
|
||||
{
|
||||
$cp_error[] = $error;
|
||||
@ -436,7 +436,7 @@ class custom_profile
|
||||
'S_PROFILE_' . strtoupper($ident) => true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $tpl_fields;
|
||||
}
|
||||
else
|
||||
@ -562,11 +562,11 @@ class custom_profile
|
||||
// checkbox - only testing for isset
|
||||
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
|
||||
{
|
||||
$value = (request::is_set($profile_row['field_ident'])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
|
||||
$value = (phpbb_request::is_set($profile_row['field_ident'])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
|
||||
}
|
||||
else if ($profile_row['field_type'] == FIELD_INT)
|
||||
{
|
||||
if (request::is_set($profile_row['field_ident']))
|
||||
if (phpbb_request::is_set($profile_row['field_ident']))
|
||||
{
|
||||
$value = (request_var($profile_row['field_ident'], '') === '') ? null : request_var($profile_row['field_ident'], $default_value);
|
||||
}
|
||||
@ -590,8 +590,8 @@ class custom_profile
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = (request::is_set($profile_row['field_ident'])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
|
||||
|
||||
$value = (phpbb_request::is_set($profile_row['field_ident'])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
|
||||
|
||||
if (gettype($value) == 'string')
|
||||
{
|
||||
$value = utf8_normalize_nfc($value);
|
||||
@ -633,7 +633,7 @@ class custom_profile
|
||||
|
||||
$now = getdate();
|
||||
|
||||
if (!request::is_set($profile_row['field_ident'] . '_day'))
|
||||
if (!phpbb_request::is_set($profile_row['field_ident'] . '_day'))
|
||||
{
|
||||
if ($profile_row['field_default_value'] == 'now')
|
||||
{
|
||||
@ -674,7 +674,7 @@ class custom_profile
|
||||
$profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>";
|
||||
}
|
||||
unset($now);
|
||||
|
||||
|
||||
$profile_row['field_value'] = 0;
|
||||
$template->assign_block_vars(self::$profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
|
||||
}
|
||||
@ -827,7 +827,7 @@ class custom_profile
|
||||
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
return $cp_data;
|
||||
}
|
||||
|
||||
@ -838,14 +838,14 @@ class custom_profile
|
||||
private function get_profile_field($profile_row)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
||||
$var_name = 'pf_' . $profile_row['field_ident'];
|
||||
|
||||
|
||||
switch ($profile_row['field_type'])
|
||||
{
|
||||
case FIELD_DATE:
|
||||
|
||||
if (!request::is_set($var_name . '_day'))
|
||||
if (!phpbb_request::is_set($var_name . '_day'))
|
||||
{
|
||||
if ($profile_row['field_default_value'] == 'now')
|
||||
{
|
||||
@ -860,7 +860,7 @@ class custom_profile
|
||||
$month = request_var($var_name . '_month', 0);
|
||||
$year = request_var($var_name . '_year', 0);
|
||||
}
|
||||
|
||||
|
||||
$var = sprintf('%2d-%2d-%4d', $day, $month, $year);
|
||||
break;
|
||||
|
||||
@ -868,7 +868,7 @@ class custom_profile
|
||||
// Checkbox
|
||||
if ($profile_row['field_length'] == 2)
|
||||
{
|
||||
$var = request::is_set($var_name) ? 1 : 0;
|
||||
$var = phpbb_request::is_set($var_name) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -882,7 +882,7 @@ class custom_profile
|
||||
break;
|
||||
|
||||
case FIELD_INT:
|
||||
if (request::is_set($var_name) && request_var($var_name, '') === '')
|
||||
if (phpbb_request::is_set($var_name) && request_var($var_name, '') === '')
|
||||
{
|
||||
$var = NULL;
|
||||
}
|
||||
@ -931,7 +931,7 @@ class custom_profile_admin extends custom_profile
|
||||
|
||||
return $validate_options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get string options for second step in ACP
|
||||
*/
|
||||
|
@ -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
|
||||
@ -274,7 +274,7 @@ class acp_attachments
|
||||
{
|
||||
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
|
||||
}
|
||||
|
||||
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
if (empty($content))
|
||||
{
|
||||
@ -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'));
|
||||
@ -109,7 +109,7 @@ class acp_ban
|
||||
'L_NO_BAN_CELL' => $l_no_ban_cell,
|
||||
|
||||
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
||||
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_ban&field=ban'),
|
||||
));
|
||||
|
@ -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';
|
||||
}
|
||||
@ -157,7 +157,7 @@ class acp_bots
|
||||
{
|
||||
$error[] = $user->lang['ERR_BOT_NO_MATCHES'];
|
||||
}
|
||||
|
||||
|
||||
if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip']))
|
||||
{
|
||||
if (!$ip_list = gethostbynamel($bot_row['bot_ip']))
|
||||
@ -176,7 +176,7 @@ class acp_bots
|
||||
{
|
||||
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
|
||||
}
|
||||
|
||||
|
||||
$bot_name = false;
|
||||
if ($bot_id)
|
||||
{
|
||||
@ -201,7 +201,7 @@ class acp_bots
|
||||
{
|
||||
$error[] = $user->lang['BOT_NAME_TAKEN'];
|
||||
}
|
||||
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
// New bot? Create a new user and group entry
|
||||
@ -219,7 +219,7 @@ class acp_bots
|
||||
{
|
||||
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$user_id = user_add(array(
|
||||
'user_type' => (int) USER_IGNORE,
|
||||
@ -233,7 +233,7 @@ class acp_bots
|
||||
'user_style' => (int) $bot_row['bot_style'],
|
||||
'user_allow_massemail' => 0,
|
||||
));
|
||||
|
||||
|
||||
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||
'user_id' => (int) $user_id,
|
||||
'bot_name' => (string) $bot_row['bot_name'],
|
||||
@ -242,7 +242,7 @@ class acp_bots
|
||||
'bot_ip' => (string) $bot_row['bot_ip'])
|
||||
);
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
$log = 'ADDED';
|
||||
}
|
||||
else if ($bot_id)
|
||||
@ -289,12 +289,12 @@ class acp_bots
|
||||
|
||||
$log = 'UPDATED';
|
||||
}
|
||||
|
||||
|
||||
$cache->destroy('_bots');
|
||||
|
||||
|
||||
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
|
||||
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if ($bot_id)
|
||||
@ -335,11 +335,11 @@ class acp_bots
|
||||
'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action",
|
||||
'U_BACK' => $this->u_action,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
|
||||
'BOT_NAME' => $bot_row['bot_name'],
|
||||
'BOT_IP' => $bot_row['bot_ip'],
|
||||
'BOT_AGENT' => $bot_row['bot_agent'],
|
||||
|
||||
|
||||
'S_EDIT_BOT' => true,
|
||||
'S_ACTIVE_OPTIONS' => $s_active_options,
|
||||
'S_STYLE_OPTIONS' => $style_select,
|
||||
@ -389,7 +389,7 @@ class acp_bots
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate bot name against username table
|
||||
*/
|
||||
@ -409,7 +409,7 @@ class acp_bots
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
return ($row) ? false : true;
|
||||
}
|
||||
}
|
||||
|
@ -34,13 +34,13 @@ class acp_captcha
|
||||
|
||||
$selected = request_var('select_captcha', $config['captcha_plugin']);
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
// Delegate
|
||||
if ($configure)
|
||||
{
|
||||
@ -106,7 +106,7 @@ class acp_captcha
|
||||
}
|
||||
|
||||
$demo_captcha = phpbb_captcha_factory::get_instance($selected);
|
||||
|
||||
|
||||
foreach ($config_vars as $config_var => $template_var)
|
||||
{
|
||||
$template->assign_var($template_var, request_var($config_var, $config[$config_var])) ;
|
||||
@ -117,28 +117,28 @@ class acp_captcha
|
||||
'CAPTCHA_SELECT' => $captcha_select,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Entry point for delivering image CAPTCHAs in the ACP.
|
||||
*/
|
||||
function deliver_demo($selected)
|
||||
{
|
||||
global $db, $user, $config;
|
||||
|
||||
|
||||
$captcha = phpbb_captcha_factory::get_instance($selected);
|
||||
$captcha->init(CONFIRM_REG);
|
||||
$captcha->execute_demo();
|
||||
garbage_collection();
|
||||
exit_handler();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -26,14 +26,14 @@ class acp_database
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $cache, $db, $user, $auth, $template, $table_prefix, $config;
|
||||
|
||||
|
||||
$user->add_lang('acp/database');
|
||||
|
||||
$this->tpl_name = '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
|
||||
@ -187,7 +187,7 @@ class acp_database
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action . '&action=download'
|
||||
));
|
||||
|
||||
|
||||
$available_methods = array('gzip' => 'zlib', 'bzip2' => 'bz2');
|
||||
|
||||
foreach ($available_methods as $type => $module)
|
||||
@ -506,7 +506,7 @@ class base_extractor
|
||||
header('Pragma: no-cache');
|
||||
header("Content-Type: $mimetype; name=\"$name\"");
|
||||
header("Content-disposition: attachment; filename=$name");
|
||||
|
||||
|
||||
switch ($format)
|
||||
{
|
||||
case 'bzip2':
|
||||
@ -525,13 +525,13 @@ class base_extractor
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($store == true)
|
||||
{
|
||||
$file = PHPBB_ROOT_PATH . 'store/' . $filename . $ext;
|
||||
|
||||
|
||||
$this->fp = $open($file, 'w');
|
||||
|
||||
|
||||
if (!$this->fp)
|
||||
{
|
||||
trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
|
||||
@ -647,11 +647,11 @@ class mysql_extractor extends base_extractor
|
||||
if ($result != false)
|
||||
{
|
||||
$fields_cnt = mysqli_num_fields($result);
|
||||
|
||||
|
||||
// Get field information
|
||||
$field = mysqli_fetch_fields($result);
|
||||
$field_set = array();
|
||||
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; $j++)
|
||||
{
|
||||
$field_set[] = $field[$j]->name;
|
||||
@ -664,7 +664,7 @@ class mysql_extractor extends base_extractor
|
||||
$first_set = true;
|
||||
$query_len = 0;
|
||||
$max_len = get_usable_memory();
|
||||
|
||||
|
||||
while ($row = mysqli_fetch_row($result))
|
||||
{
|
||||
$values = array();
|
||||
@ -735,7 +735,7 @@ class mysql_extractor extends base_extractor
|
||||
$field[] = mysql_fetch_field($result, $i);
|
||||
}
|
||||
$field_set = array();
|
||||
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; $j++)
|
||||
{
|
||||
$field_set[] = $field[$j]->name;
|
||||
@ -844,7 +844,7 @@ class sqlite_extractor extends base_extractor
|
||||
$ar[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
foreach ($ar as $value)
|
||||
{
|
||||
if (strpos($value['name'], 'autoindex') !== false)
|
||||
@ -1002,7 +1002,7 @@ class postgres_extractor extends base_extractor
|
||||
$sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
|
||||
FROM pg_class c, pg_attribute a, pg_type t
|
||||
WHERE c.relname = '" . $db->sql_escape($table_name) . "'
|
||||
@ -1066,7 +1066,7 @@ class postgres_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
|
||||
$lines[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@ -1266,33 +1266,33 @@ class mssql_extractor extends base_extractor
|
||||
$sql_data .= "GO\n";
|
||||
$sql_data .= "\nCREATE TABLE [$table_name] (\n";
|
||||
$rows = array();
|
||||
|
||||
|
||||
$text_flag = false;
|
||||
|
||||
|
||||
$sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_NAME = '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]";
|
||||
|
||||
|
||||
if ($row['DATA_TYPE'] == 'text')
|
||||
{
|
||||
$text_flag = true;
|
||||
}
|
||||
|
||||
|
||||
if ($row['IS_IDENTITY'])
|
||||
{
|
||||
$line .= ' IDENTITY (1 , 1)';
|
||||
}
|
||||
|
||||
|
||||
if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text')
|
||||
{
|
||||
$line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')';
|
||||
}
|
||||
|
||||
|
||||
if ($row['IS_NULLABLE'] == 'YES')
|
||||
{
|
||||
$line .= ' NULL';
|
||||
@ -1301,27 +1301,27 @@ class mssql_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
|
||||
if ($row['COLUMN_DEFAULT'])
|
||||
{
|
||||
$line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
|
||||
}
|
||||
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$sql_data .= implode(",\n", $rows);
|
||||
$sql_data .= "\n) ON [PRIMARY]";
|
||||
|
||||
|
||||
if ($text_flag)
|
||||
{
|
||||
$sql_data .= " TEXTIMAGE_ON [PRIMARY]";
|
||||
}
|
||||
|
||||
|
||||
$sql_data .= "\nGO\n\n";
|
||||
$rows = array();
|
||||
|
||||
|
||||
$sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME
|
||||
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
|
||||
WHERE TABLE_NAME = '$table_name'";
|
||||
@ -1341,7 +1341,7 @@ class mssql_extractor extends base_extractor
|
||||
$sql_data .= "\n\t) ON [PRIMARY] \nGO\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$index = array();
|
||||
$sql = "EXEC sp_statistics '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
@ -1353,12 +1353,12 @@ class mssql_extractor extends base_extractor
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
foreach ($index as $index_name => $column_name)
|
||||
{
|
||||
$index[$index_name] = implode(', ', $column_name);
|
||||
}
|
||||
|
||||
|
||||
foreach ($index as $index_name => $columns)
|
||||
{
|
||||
$sql_data .= "\nCREATE INDEX [$index_name] ON [$table_name]($columns) ON [PRIMARY]\nGO\n";
|
||||
@ -1391,7 +1391,7 @@ class mssql_extractor extends base_extractor
|
||||
$ary_type = $ary_name = array();
|
||||
$ident_set = false;
|
||||
$sql_data = '';
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@ -1485,7 +1485,7 @@ class mssql_extractor extends base_extractor
|
||||
$ary_type = $ary_name = array();
|
||||
$ident_set = false;
|
||||
$sql_data = '';
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@ -1604,7 +1604,7 @@ class db2_extractor extends base_extractor
|
||||
FROM syscat.columns
|
||||
WHERE tabname = '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = "\t{$row['colname']} {$row['typename']}";
|
||||
@ -1613,12 +1613,12 @@ class db2_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1)';
|
||||
}
|
||||
|
||||
|
||||
if ($row['typename'] == 'VARCHAR' || $row['typename'] == 'CHARACTER' || $row['typename'] == 'CLOB')
|
||||
{
|
||||
$line .= ' (' . $row['length'] . ')';
|
||||
}
|
||||
|
||||
|
||||
if ($row['nulls'] == 'N')
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
@ -1632,7 +1632,7 @@ class db2_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' DEFAULT ' . $row['default'];
|
||||
}
|
||||
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@ -1871,7 +1871,7 @@ class oracle_extractor extends base_extractor
|
||||
{
|
||||
global $db;
|
||||
$ary_type = $ary_name = array();
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@ -1967,7 +1967,7 @@ class firebird_extractor extends base_extractor
|
||||
{
|
||||
global $db;
|
||||
$ary_type = $ary_name = array();
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@ -2296,7 +2296,7 @@ function fgetd(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
|
||||
{
|
||||
$record = '';
|
||||
$delim_len = strlen($delim);
|
||||
|
||||
|
||||
while (!$eof($fp))
|
||||
{
|
||||
$pos = strpos($record, $delim);
|
||||
|
@ -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))
|
||||
@ -107,7 +107,7 @@ class acp_email
|
||||
$db->sql_freeresult($result);
|
||||
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$i = $j = 0;
|
||||
|
||||
// Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
|
||||
@ -172,7 +172,7 @@ class acp_email
|
||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
|
||||
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
|
||||
|
||||
|
||||
$messenger->subject(htmlspecialchars_decode($subject));
|
||||
$messenger->set_mail_priority($priority);
|
||||
|
||||
@ -180,7 +180,7 @@ class acp_email
|
||||
'CONTACT_EMAIL' => $config['board_contact'],
|
||||
'MESSAGE' => htmlspecialchars_decode($message))
|
||||
);
|
||||
|
||||
|
||||
if (!($messenger->send($used_method)))
|
||||
{
|
||||
$errored = true;
|
||||
@ -238,7 +238,7 @@ class acp_email
|
||||
|
||||
$select_list = '<option value="0"' . ((!$group_id) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
|
||||
$select_list .= group_select_options($group_id, $exclude);
|
||||
|
||||
|
||||
$s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
|
||||
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
|
||||
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
|
||||
|
@ -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';
|
||||
@ -167,19 +167,19 @@ class acp_icons
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM $table
|
||||
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
$data = array();
|
||||
$after = false;
|
||||
$display = 0;
|
||||
$order_lists = array('', '');
|
||||
$add_order_lists = array('', '');
|
||||
$display_count = 0;
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($action == 'add')
|
||||
@ -233,12 +233,12 @@ class acp_icons
|
||||
$colspan = (($mode == 'smilies') ? '7' : '5');
|
||||
$colspan += ($icon_id) ? 1 : 0;
|
||||
$colspan += ($action == 'add') ? 2 : 0;
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_EDIT' => true,
|
||||
'S_SMILIES' => ($mode == 'smilies') ? true : false,
|
||||
'S_ADD' => ($action == 'add') ? true : false,
|
||||
|
||||
|
||||
'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1],
|
||||
'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0],
|
||||
'S_ORDER_LIST_DISPLAY_COUNT' => $display_count + 1,
|
||||
@ -285,10 +285,10 @@ class acp_icons
|
||||
'S_ADD_CODE' => true,
|
||||
|
||||
'S_IMG_OPTIONS' => $smiley_options,
|
||||
|
||||
|
||||
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
|
||||
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
|
||||
|
||||
|
||||
'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $default_row['smiley_url'],
|
||||
'IMG_PATH' => $img_path,
|
||||
'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||
@ -302,27 +302,27 @@ class acp_icons
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'create':
|
||||
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;
|
||||
}
|
||||
@ -425,13 +425,13 @@ class acp_icons
|
||||
$db->sql_query($sql);
|
||||
$icons_updated++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cache->destroy('_icons');
|
||||
$cache->destroy('sql', $table);
|
||||
|
||||
|
||||
$level = E_USER_NOTICE;
|
||||
switch ($icons_updated)
|
||||
{
|
||||
@ -439,11 +439,11 @@ class acp_icons
|
||||
$suc_lang = "{$lang}_NONE";
|
||||
$level = E_USER_WARNING;
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
$suc_lang = "{$lang}_ONE";
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$suc_lang = $lang;
|
||||
}
|
||||
|
@ -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);
|
||||
@ -66,7 +66,7 @@ class acp_inactive
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $mark);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
$user_affected = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@ -196,7 +196,7 @@ class acp_inactive
|
||||
unset($usernames);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -246,7 +246,7 @@ class acp_inactive
|
||||
'S_SORT_DIR' => $s_sort_dir,
|
||||
'S_ON_PAGE' => on_page($inactive_count, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true),
|
||||
|
||||
|
||||
'U_ACTION' => $this->u_action . '&start=' . $start,
|
||||
));
|
||||
|
||||
|
@ -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);
|
||||
|
||||
@ -194,7 +194,7 @@ class acp_language
|
||||
case 'submit_file':
|
||||
case 'download_file':
|
||||
case 'upload_data':
|
||||
|
||||
|
||||
if (!$submit || !check_form_key($form_name))
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
@ -274,16 +274,16 @@ class acp_language
|
||||
if (!$safe_mode)
|
||||
{
|
||||
$mkdir_ary = array('language', 'language/' . $row['lang_iso']);
|
||||
|
||||
|
||||
if ($this->language_directory)
|
||||
{
|
||||
$mkdir_ary[] = 'language/' . $row['lang_iso'] . '/' . $this->language_directory;
|
||||
}
|
||||
|
||||
|
||||
foreach ($mkdir_ary as $dir)
|
||||
{
|
||||
$dir = PHPBB_ROOT_PATH . 'store/' . $dir;
|
||||
|
||||
|
||||
if (!is_dir($dir))
|
||||
{
|
||||
if (!@mkdir($dir, 0777))
|
||||
@ -329,7 +329,7 @@ class acp_language
|
||||
}
|
||||
|
||||
$entry = "\tarray(\n";
|
||||
|
||||
|
||||
foreach ($value as $_key => $_value)
|
||||
{
|
||||
$entry .= "\t\t" . (int) $_key . "\t=> '" . $this->prepare_lang_entry($_value) . "',\n";
|
||||
@ -446,7 +446,7 @@ class acp_language
|
||||
{
|
||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
||||
|
||||
$sql = 'SELECT *
|
||||
@ -455,7 +455,7 @@ class acp_language
|
||||
$result = $db->sql_query($sql);
|
||||
$lang_entries = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$lang_iso = $lang_entries['lang_iso'];
|
||||
$missing_vars = $missing_files = array();
|
||||
|
||||
@ -501,8 +501,8 @@ class acp_language
|
||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@ -545,7 +545,7 @@ class acp_language
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file)))
|
||||
{
|
||||
$missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars[$file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@ -563,7 +563,7 @@ class acp_language
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'acp', $file)))
|
||||
{
|
||||
$missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars['acp/' . $file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@ -582,7 +582,7 @@ class acp_language
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'mods', $file)))
|
||||
{
|
||||
$missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars['mods/' . $file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@ -594,7 +594,7 @@ class acp_language
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// More missing files... for example email templates?
|
||||
foreach ($email_files as $file)
|
||||
{
|
||||
@ -1059,7 +1059,7 @@ class acp_language
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/index.html');
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/email/index.html');
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/acp/index.html');
|
||||
|
||||
|
||||
if (sizeof($mod_files))
|
||||
{
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/mods/index.html');
|
||||
@ -1219,7 +1219,7 @@ $lang = array_merge($lang, array(
|
||||
function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
|
||||
{
|
||||
global $safe_mode;
|
||||
|
||||
|
||||
$check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
|
||||
|
||||
if ($check_store)
|
||||
|
@ -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
|
||||
@ -112,7 +112,7 @@ class acp_logs
|
||||
if ($mode == 'mod')
|
||||
{
|
||||
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SHOW_FORUMS' => true,
|
||||
'S_FORUM_BOX' => $forum_box)
|
||||
@ -142,7 +142,7 @@ class acp_logs
|
||||
foreach ($log_data as $row)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
|
||||
$checks = array('viewtopic', 'viewlogs', 'viewforum');
|
||||
foreach ($checks as $check)
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ class acp_modules
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'enable':
|
||||
case 'disable':
|
||||
if (!$module_id)
|
||||
@ -175,7 +175,7 @@ class acp_modules
|
||||
add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']), $move_module_name);
|
||||
$this->remove_cache_file();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'quickadd':
|
||||
@ -212,7 +212,7 @@ class acp_modules
|
||||
if (!sizeof($errors))
|
||||
{
|
||||
$this->remove_cache_file();
|
||||
|
||||
|
||||
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
}
|
||||
}
|
||||
@ -236,7 +236,7 @@ class acp_modules
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$module_row = $this->get_module_row($module_id);
|
||||
|
||||
// no break
|
||||
@ -255,7 +255,7 @@ class acp_modules
|
||||
'module_auth' => '',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$module_data = array();
|
||||
|
||||
$module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']);
|
||||
@ -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)
|
||||
{
|
||||
@ -300,7 +300,7 @@ class acp_modules
|
||||
if (!sizeof($errors))
|
||||
{
|
||||
$this->remove_cache_file();
|
||||
|
||||
|
||||
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
}
|
||||
}
|
||||
@ -332,7 +332,7 @@ class acp_modules
|
||||
{
|
||||
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
|
||||
}
|
||||
|
||||
|
||||
$template->assign_block_vars('m_names.modes', array(
|
||||
'OPTION' => $m_mode,
|
||||
'VALUE' => $this->lang_name($m_values['title']),
|
||||
@ -341,7 +341,7 @@ class acp_modules
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$s_cat_option = '<option value="0"' . (($module_data['parent_id'] == 0) ? ' selected="selected"' : '') . '>' . $user->lang['NO_PARENT'] . '</option>';
|
||||
|
||||
$template->assign_vars(array_merge(array(
|
||||
@ -354,7 +354,7 @@ class acp_modules
|
||||
'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id,
|
||||
|
||||
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
|
||||
|
||||
|
||||
'MODULENAME' => $this->lang_name($module_data['module_langname']),
|
||||
'ACTION' => $action,
|
||||
'MODULE_ID' => $module_id,
|
||||
@ -521,7 +521,7 @@ class acp_modules
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
@ -529,7 +529,7 @@ class acp_modules
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get available module information from module files
|
||||
*/
|
||||
@ -592,7 +592,7 @@ class acp_modules
|
||||
$fileinfo[str_replace($module_class . '_', '', $module_info['filename'])] = $module_info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $fileinfo;
|
||||
}
|
||||
|
||||
@ -724,7 +724,7 @@ class acp_modules
|
||||
|
||||
// Sanitise for future path use, it's escaped as appropriate for queries
|
||||
$p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
|
||||
|
||||
|
||||
$cache->destroy('_modules_' . $p_class);
|
||||
|
||||
// Additionally remove sql cache
|
||||
|
@ -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);
|
||||
@ -277,7 +277,7 @@ class acp_permission_roles
|
||||
{
|
||||
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . ACL_ROLES_TABLE . '
|
||||
WHERE role_id = ' . $role_id;
|
||||
|
@ -23,7 +23,7 @@ class acp_permissions
|
||||
{
|
||||
var $u_action;
|
||||
var $permission_dropdown;
|
||||
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
@ -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);
|
||||
@ -93,7 +93,7 @@ class acp_permissions
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
// Map usernames to ids and vice versa
|
||||
if ($usernames)
|
||||
{
|
||||
@ -111,7 +111,7 @@ class acp_permissions
|
||||
}
|
||||
}
|
||||
unset($username);
|
||||
|
||||
|
||||
// Build forum ids (of all forums are checked or subforum listing used)
|
||||
if ($all_forums)
|
||||
{
|
||||
@ -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))
|
||||
{
|
||||
@ -527,7 +527,7 @@ class acp_permissions
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ($branch_there)
|
||||
{
|
||||
$s_options .= ' [' . $user->lang['PLUS_SUBFORUMS'] . ']';
|
||||
@ -538,14 +538,14 @@ class acp_permissions
|
||||
|
||||
return $s_options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build dropdown field for changing permission types
|
||||
*/
|
||||
function build_permission_dropdown($options, $default_option, $permission_scope)
|
||||
{
|
||||
global $user, $auth;
|
||||
|
||||
|
||||
$s_dropdown_options = '';
|
||||
foreach ($options as $setting)
|
||||
{
|
||||
@ -625,21 +625,21 @@ class acp_permissions
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$ug_id = $forum_id = 0;
|
||||
|
||||
// We loop through the auth settings defined in our submit
|
||||
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
|
||||
@ -802,7 +802,7 @@ class acp_permissions
|
||||
function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id)
|
||||
{
|
||||
global $user, $db, $auth;
|
||||
|
||||
|
||||
// User or group to be set?
|
||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||
|
||||
|
@ -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 = '';
|
||||
@ -76,7 +76,7 @@ class acp_profile
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
ORDER BY lang_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// Which languages are available for each item
|
||||
@ -204,7 +204,7 @@ class acp_profile
|
||||
'field_id' => $field_id,
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'activate':
|
||||
@ -214,7 +214,7 @@ class acp_profile
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT lang_id
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
@ -251,7 +251,7 @@ class acp_profile
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
|
||||
SET field_active = 0
|
||||
WHERE field_id = $field_id";
|
||||
@ -283,12 +283,12 @@ class acp_profile
|
||||
|
||||
case 'create':
|
||||
case 'edit':
|
||||
|
||||
|
||||
$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']];
|
||||
@ -352,9 +352,9 @@ class acp_profile
|
||||
{
|
||||
// We are adding a new field, define basic params
|
||||
$lang_options = $field_row = array();
|
||||
|
||||
|
||||
$field_type = request_var('field_type', 0);
|
||||
|
||||
|
||||
if (!$field_type)
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
@ -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);
|
||||
@ -479,7 +479,7 @@ class acp_profile
|
||||
else if ($field_type == FIELD_DATE && $key == 'field_default_value')
|
||||
{
|
||||
$always_now = request_var('always_now', -1);
|
||||
|
||||
|
||||
if ($always_now == 1 || ($always_now === -1 && $var == 'now'))
|
||||
{
|
||||
$now = getdate();
|
||||
@ -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,14 +506,14 @@ 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
|
||||
{
|
||||
list($cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']) = explode('-', $var);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
|
||||
{
|
||||
@ -542,7 +542,7 @@ class acp_profile
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
|
||||
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
WHERE lang_id <> ' . $this->edit_lang_id . "
|
||||
@ -559,7 +559,7 @@ class acp_profile
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
foreach ($exclude[3] as $key)
|
||||
{
|
||||
$cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true));
|
||||
@ -578,7 +578,7 @@ class acp_profile
|
||||
{
|
||||
$cp->vars[$key][$lang_id] = explode("\n", $options);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -722,7 +722,7 @@ class acp_profile
|
||||
|
||||
'L_TITLE' => $user->lang['STEP_' . $step . '_TITLE_' . strtoupper($action)],
|
||||
'L_EXPLAIN' => $user->lang['STEP_' . $step . '_EXPLAIN_' . strtoupper($action)],
|
||||
|
||||
|
||||
'U_ACTION' => $this->u_action . "&action=$action&step=$step",
|
||||
'U_BACK' => $this->u_action)
|
||||
);
|
||||
@ -732,7 +732,7 @@ class acp_profile
|
||||
{
|
||||
// Create basic options - only small differences between field types
|
||||
case 1:
|
||||
|
||||
|
||||
// Build common create options
|
||||
$template->assign_vars(array(
|
||||
'S_STEP_ONE' => true,
|
||||
@ -759,7 +759,7 @@ class acp_profile
|
||||
'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
|
||||
{
|
||||
// Initialize these array elements if we are creating a new field
|
||||
@ -788,11 +788,11 @@ class acp_profile
|
||||
'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_STEP_TWO' => true,
|
||||
'L_NEXT_STEP' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS'])
|
||||
@ -830,7 +830,7 @@ class acp_profile
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ class acp_profile
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PROFILE_FIELDS_TABLE . '
|
||||
ORDER BY field_order';
|
||||
@ -918,14 +918,14 @@ class acp_profile
|
||||
$languages[$row['lang_id']] = $row['lang_iso'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$options = array();
|
||||
$options['lang_name'] = 'string';
|
||||
if ($cp->vars['lang_explain'])
|
||||
{
|
||||
$options['lang_explain'] = 'text';
|
||||
}
|
||||
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
case FIELD_BOOL:
|
||||
@ -935,7 +935,7 @@ class acp_profile
|
||||
case FIELD_DROPDOWN:
|
||||
$options['lang_options'] = 'optionfield';
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_TEXT:
|
||||
case FIELD_STRING:
|
||||
if ($cp->vars['lang_default_value'])
|
||||
@ -944,7 +944,7 @@ class acp_profile
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$lang_options = array();
|
||||
|
||||
foreach ($options as $field => $field_type)
|
||||
@ -970,7 +970,7 @@ class acp_profile
|
||||
if ($field == 'lang_options')
|
||||
{
|
||||
$var = (!isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id];
|
||||
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
case 'two_options':
|
||||
@ -991,7 +991,7 @@ class acp_profile
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN']))
|
||||
{
|
||||
$lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
|
||||
@ -1005,7 +1005,7 @@ class acp_profile
|
||||
'TITLE' => $user->lang['CP_' . strtoupper($field)],
|
||||
'FIELD' => ($field_type == 'string') ? '<dd><input class="medium" type="text" name="l_' . $field . '[' . $lang_id . ']" value="' . ((isset($value[$lang_id])) ? $value[$lang_id] : $var) . '" /></dd>' : '<dd><textarea name="l_' . $field . '[' . $lang_id . ']" rows="3" cols="80">' . ((isset($value[$lang_id])) ? $value[$lang_id] : $var) . '</textarea></dd>'
|
||||
);
|
||||
|
||||
|
||||
if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN']))
|
||||
{
|
||||
$lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
|
||||
@ -1078,7 +1078,7 @@ class acp_profile
|
||||
WHERE field_id = $field_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
$field_ident = 'pf_' . $field_ident;
|
||||
@ -1095,7 +1095,7 @@ class acp_profile
|
||||
{
|
||||
$sql_ary['field_id'] = $field_id;
|
||||
$sql_ary['lang_id'] = $default_lang_id;
|
||||
|
||||
|
||||
$profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
}
|
||||
else
|
||||
@ -1168,7 +1168,7 @@ class acp_profile
|
||||
AND lang_id = " . (int) $default_lang_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
foreach ($cp->vars['lang_options'] as $option_id => $value)
|
||||
{
|
||||
$sql_ary = array(
|
||||
@ -1271,7 +1271,7 @@ class acp_profile
|
||||
$lang_id = $sql['lang_id'];
|
||||
$option_id = $sql['option_id'];
|
||||
unset($sql['lang_id'], $sql['field_id'], $sql['option_id']);
|
||||
|
||||
|
||||
$this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql, array(
|
||||
'lang_id' => $lang_id,
|
||||
'field_id' => $field_id,
|
||||
@ -1291,7 +1291,7 @@ class acp_profile
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
if ($action == 'edit')
|
||||
@ -1337,7 +1337,7 @@ class acp_profile
|
||||
if (!$row)
|
||||
{
|
||||
$sql_ary = array_merge($where_fields, $sql_ary);
|
||||
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
{
|
||||
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql_ary));
|
||||
@ -1387,7 +1387,7 @@ class acp_profile
|
||||
case FIELD_BOOL:
|
||||
$sql .= 'TINYINT(2) ';
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_DROPDOWN:
|
||||
$sql .= 'MEDIUMINT(8) ';
|
||||
break;
|
||||
|
@ -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)
|
||||
{
|
||||
@ -79,7 +79,7 @@ class acp_prune
|
||||
$prune_posted = request_var('prune_days', 0);
|
||||
$prune_viewed = request_var('prune_vieweddays', 0);
|
||||
$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;
|
||||
|
||||
|
||||
$prune_flags = 0;
|
||||
$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
|
||||
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
|
||||
@ -109,7 +109,7 @@ class acp_prune
|
||||
$p_result['topics'] = 0;
|
||||
$p_result['posts'] = 0;
|
||||
$log_data = '';
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
if (!$auth->acl_get('f_list', $row['forum_id']))
|
||||
@ -129,7 +129,7 @@ class acp_prune
|
||||
$p_result['topics'] += $return['topics'];
|
||||
$p_result['posts'] += $return['posts'];
|
||||
}
|
||||
|
||||
|
||||
if ($prune_viewed)
|
||||
{
|
||||
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
|
||||
@ -145,11 +145,11 @@ class acp_prune
|
||||
'NUM_TOPICS' => $p_result['topics'],
|
||||
'NUM_POSTS' => $p_result['posts'])
|
||||
);
|
||||
|
||||
|
||||
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
|
||||
// Sync all pruned forums at once
|
||||
sync('forum', 'forum_id', $prune_ids, true, true);
|
||||
add_log('admin', 'LOG_PRUNE', $log_data);
|
||||
@ -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)
|
||||
{
|
||||
@ -258,7 +258,7 @@ class acp_prune
|
||||
{
|
||||
user_delete('remove', $user_id);
|
||||
}
|
||||
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
|
||||
}
|
||||
else
|
||||
@ -344,7 +344,7 @@ class acp_prune
|
||||
{
|
||||
$s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
|
||||
$s_find_active_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
@ -368,7 +368,7 @@ class acp_prune
|
||||
global $user, $db;
|
||||
|
||||
$users = request_var('users', '', true);
|
||||
|
||||
|
||||
if ($users)
|
||||
{
|
||||
$users = explode("\n", $users);
|
||||
|
@ -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';
|
||||
@ -71,7 +71,7 @@ class acp_ranks
|
||||
'rank_min' => $min_posts,
|
||||
'rank_image' => htmlspecialchars_decode($rank_image)
|
||||
);
|
||||
|
||||
|
||||
if ($rank_id)
|
||||
{
|
||||
$sql = 'UPDATE ' . RANKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rank_id = $rank_id";
|
||||
@ -139,7 +139,7 @@ class acp_ranks
|
||||
case 'add':
|
||||
|
||||
$data = $ranks = $existing_imgs = array();
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . RANKS_TABLE . '
|
||||
ORDER BY rank_min ASC, rank_special ASC';
|
||||
@ -204,13 +204,13 @@ class acp_ranks
|
||||
'S_SPECIAL_RANK' => (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,
|
||||
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
|
||||
);
|
||||
|
||||
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action)
|
||||
);
|
||||
@ -232,7 +232,7 @@ class acp_ranks
|
||||
|
||||
'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['rank_id'],
|
||||
'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['rank_id'])
|
||||
);
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
@ -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';
|
||||
@ -113,7 +113,7 @@ class acp_reasons
|
||||
$result = $db->sql_query($sql);
|
||||
$max_order = (int) $db->sql_fetchfield('max_reason_order');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$sql_ary = array(
|
||||
'reason_title' => (string) $reason_row['reason_title'],
|
||||
'reason_description' => (string) $reason_row['reason_description'],
|
||||
@ -171,7 +171,7 @@ class acp_reasons
|
||||
'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action",
|
||||
'U_BACK' => $this->u_action,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
|
||||
'REASON_TITLE' => $reason_row['reason_title'],
|
||||
'REASON_DESCRIPTION' => $reason_row['reason_description'],
|
||||
|
||||
@ -271,7 +271,7 @@ class acp_reasons
|
||||
do
|
||||
{
|
||||
++$order;
|
||||
|
||||
|
||||
if ($row['reason_order'] != $order)
|
||||
{
|
||||
$sql = 'UPDATE ' . REPORTS_REASONS_TABLE . "
|
||||
|
@ -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
|
||||
|
@ -23,7 +23,7 @@ if (!defined('IN_PHPBB'))
|
||||
class acp_words
|
||||
{
|
||||
var $u_action;
|
||||
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
@ -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();
|
||||
@ -47,7 +47,7 @@ class acp_words
|
||||
{
|
||||
case 'edit':
|
||||
$word_id = request_var('id', 0);
|
||||
|
||||
|
||||
if (!$word_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
@ -72,7 +72,7 @@ class acp_words
|
||||
'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
);
|
||||
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
@ -86,7 +86,7 @@ class acp_words
|
||||
$word_id = request_var('id', 0);
|
||||
$word = utf8_normalize_nfc(request_var('word', '', true));
|
||||
$replacement = utf8_normalize_nfc(request_var('replacement', '', true));
|
||||
|
||||
|
||||
if (!$word || !$replacement)
|
||||
{
|
||||
trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
@ -96,7 +96,7 @@ class acp_words
|
||||
'word' => $word,
|
||||
'replacement' => $replacement
|
||||
);
|
||||
|
||||
|
||||
if ($word_id)
|
||||
{
|
||||
$db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id);
|
||||
|
@ -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'));
|
||||
@ -171,7 +171,7 @@ class mcp_ban
|
||||
case 'user':
|
||||
$pre_fill = (string) $db->sql_fetchfield('username');
|
||||
break;
|
||||
|
||||
|
||||
case 'ip':
|
||||
$pre_fill = (string) $db->sql_fetchfield('user_ip');
|
||||
break;
|
||||
|
@ -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,19 +33,19 @@ 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)
|
||||
{
|
||||
case 'membership':
|
||||
|
||||
|
||||
$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,9 +407,9 @@ 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);
|
||||
|
||||
add_form_key('ucp_groups');
|
||||
@ -433,7 +433,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$group_name = $group_row['group_name'];
|
||||
$group_type = $group_row['group_type'];
|
||||
|
||||
@ -445,7 +445,7 @@ class ucp_groups
|
||||
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
|
||||
'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
|
||||
'GROUP_TYPE' => $group_row['group_type'],
|
||||
|
||||
|
||||
'AVATAR' => $avatar_img,
|
||||
'AVATAR_IMAGE' => $avatar_img,
|
||||
'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
|
||||
@ -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),
|
||||
);
|
||||
@ -599,7 +599,7 @@ class ucp_groups
|
||||
// Only set the rank, colour, etc. if it's changed or if we're adding a new
|
||||
// group. This prevents existing group members being updated if no changes
|
||||
// were made.
|
||||
|
||||
|
||||
$group_attributes = array();
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients');
|
||||
foreach ($test_variables as $test)
|
||||
@ -668,13 +668,13 @@ 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)
|
||||
{
|
||||
avatar_gallery($category, $avatar_select, 4);
|
||||
}
|
||||
|
||||
|
||||
$avatars_enabled = ($can_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;
|
||||
|
||||
$template->assign_vars(array(
|
||||
@ -692,7 +692,7 @@ class ucp_groups
|
||||
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
|
||||
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
|
||||
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
|
||||
|
||||
|
||||
'GROUP_DESC' => $group_desc_data['text'],
|
||||
'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
|
||||
'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'],
|
||||
@ -891,7 +891,7 @@ class ucp_groups
|
||||
if (!sizeof($mark_ary))
|
||||
{
|
||||
$start = 0;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
$sql = 'SELECT user_id
|
||||
@ -1022,7 +1022,7 @@ class ucp_groups
|
||||
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
|
||||
|
||||
$default = request_var('default', 0);
|
||||
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
// Add user/s to group
|
||||
|
@ -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);
|
||||
@ -66,9 +66,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||
trigger_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
@ -223,7 +223,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||
// Move Messages
|
||||
case 1:
|
||||
$num_moved = move_pm($user->data['user_id'], $user->data['message_limit'], $msg_ids, $move_to, $remove_folder_id);
|
||||
|
||||
|
||||
// Something went wrong, only partially moved?
|
||||
if ($num_moved != $folder_row['pm_count'])
|
||||
{
|
||||
@ -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;
|
||||
@ -402,7 +402,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||
$result = $db->sql_query($sql);
|
||||
$num_messages = (int) $db->sql_fetchfield('num_messages');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$folder[PRIVMSGS_INBOX] = array(
|
||||
'folder_name' => $user->lang['PM_INBOX'],
|
||||
'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $num_messages, $user->data['message_limit'])
|
||||
@ -658,7 +658,7 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
|
||||
function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
|
||||
{
|
||||
global $db, $template, $auth, $user;
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_COND_DEFINED' => true,
|
||||
'S_COND_SELECT' => (!$hardcoded && isset($global_rule_conditions[$rule_option])) ? true : false)
|
||||
@ -682,7 +682,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||
{
|
||||
case 'text':
|
||||
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_TEXT_CONDITION' => true,
|
||||
'CURRENT_STRING' => $rule_string,
|
||||
@ -696,7 +696,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||
case 'user':
|
||||
$rule_user_id = request_var('rule_user_id', 0);
|
||||
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
|
||||
|
||||
|
||||
if ($rule_string && !$rule_user_id)
|
||||
{
|
||||
$sql = 'SELECT user_id
|
||||
@ -758,10 +758,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||
{
|
||||
$sql .= 'WHERE';
|
||||
}
|
||||
|
||||
$sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
|
||||
|
||||
$sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
|
||||
ORDER BY g.group_type DESC, g.group_name ASC';
|
||||
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_group_options = '';
|
||||
@ -774,7 +774,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||
|
||||
$s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '';
|
||||
$s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : '';
|
||||
|
||||
|
||||
$s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@ -812,7 +812,7 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
|
||||
WHERE user_id = ' . $user_id . '
|
||||
ORDER BY rule_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
$count = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
@ -52,14 +52,14 @@ class ucp_register
|
||||
add_form_key('ucp_register_terms');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($config['enable_confirm'])
|
||||
{
|
||||
include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_factory.' . PHP_EXT);
|
||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$captcha->init(CONFIRM_REG);
|
||||
}
|
||||
|
||||
|
||||
if ($change_lang || $user_lang != $config['default_lang'])
|
||||
{
|
||||
$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);
|
||||
@ -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;
|
||||
@ -94,7 +94,7 @@ class ucp_register
|
||||
{
|
||||
$add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : '';
|
||||
$add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : '';
|
||||
|
||||
|
||||
$s_hidden_fields = array();
|
||||
|
||||
// If we change the language, we want to pass on some more possible parameter.
|
||||
@ -108,7 +108,7 @@ class ucp_register
|
||||
'lang' => $user->lang_name,
|
||||
'tz' => request_var('tz', (float) $config['board_timezone']),
|
||||
));
|
||||
|
||||
|
||||
if ($config['enable_confirm'])
|
||||
{
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
|
||||
@ -435,7 +435,7 @@ class ucp_register
|
||||
{
|
||||
$str = '';
|
||||
}
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
|
||||
'S_CAPTCHA' => $captcha->get_template(),
|
||||
@ -454,7 +454,7 @@ class ucp_register
|
||||
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'USERNAME' => $data['username'],
|
||||
|
@ -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();
|
||||
@ -51,7 +51,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'])
|
||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$captcha->init(CONFIRM_POST);
|
||||
}
|
||||
|
||||
|
||||
// Was cancel pressed? If so then redirect to the appropriate page
|
||||
if ($cancel || ($current_time - $lastclick < 2 && $submit))
|
||||
{
|
||||
@ -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…
x
Reference in New Issue
Block a user