Zeile 14 | Zeile 14 |
---|
* * @var string */
|
* * @var string */
|
public $version = "1.8.3";
| public $version = "1.8.26";
|
/** * The version code of MyBB we're running. * * @var integer */
|
/** * The version code of MyBB we're running. * * @var integer */
|
public $version_code = 1803;
| public $version_code = 1826;
|
/** * The current working directory.
| /** * The current working directory.
|
Zeile 68 | Zeile 68 |
---|
/** * Whether or not magic quotes are enabled. *
|
/** * Whether or not magic quotes are enabled. *
|
* @var unknown_type
| * @var int
|
*/ public $magicquotes = 0;
| */ public $magicquotes = 0;
|
Zeile 89 | Zeile 89 |
---|
/** * The request method that called this page. *
|
/** * The request method that called this page. *
|
* @var string.
| * @var string
|
*/ public $request_method = "";
/** * Whether or not PHP's safe_mode is enabled
|
*/ public $request_method = "";
/** * Whether or not PHP's safe_mode is enabled
|
* * @var boolean
| * * @var boolean
|
*/ public $safemode = false;
| */ public $safemode = false;
|
Zeile 109 | Zeile 109 |
---|
/** * Variables that need to be clean.
|
/** * Variables that need to be clean.
|
* * @var array
| * * @var array
|
*/ public $clean_variables = array( "int" => array(
| */ public $clean_variables = array( "int" => array(
|
Zeile 129 | Zeile 129 |
---|
"sortby", "order" ) );
|
"sortby", "order" ) );
|
/**
| /**
|
* Variables that are to be ignored from cleansing process * * @var array */ public $ignore_clean_variables = array();
|
* Variables that are to be ignored from cleansing process * * @var array */ public $ignore_clean_variables = array();
|
/**
| /**
|
* Using built in shutdown functionality provided by register_shutdown_function for < PHP 5?
|
* Using built in shutdown functionality provided by register_shutdown_function for < PHP 5?
|
| * * @var bool
|
*/ public $use_shutdown = true;
/** * Debug mode?
|
*/ public $use_shutdown = true;
/** * Debug mode?
|
| * * @var bool
|
*/ public $debug_mode = false;
/** * Binary database fields need to be handled differently
|
*/ public $debug_mode = false;
/** * Binary database fields need to be handled differently
|
| * * @var array
|
*/ public $binary_fields = array( 'adminlog' => array('ipaddress' => true), 'adminsessions' => array('ip' => true), 'maillogs' => array('ipaddress' => true), 'moderatorlog' => array('ipaddress' => true),
|
*/ public $binary_fields = array( 'adminlog' => array('ipaddress' => true), 'adminsessions' => array('ip' => true), 'maillogs' => array('ipaddress' => true), 'moderatorlog' => array('ipaddress' => true),
|
| 'pollvotes' => array('ipaddress' => true),
|
'posts' => array('ipaddress' => true), 'privatemessages' => array('ipaddress' => true), 'searchlog' => array('ipaddress' => true),
| 'posts' => array('ipaddress' => true), 'privatemessages' => array('ipaddress' => true), 'searchlog' => array('ipaddress' => true),
|
Zeile 163 | Zeile 170 |
---|
'users' => array('regip' => true, 'lastip' => true), 'spamlog' => array('ipaddress' => true), );
|
'users' => array('regip' => true, 'lastip' => true), 'spamlog' => array('ipaddress' => true), );
|
|
|
/** * The cache instance to use. *
| /** * The cache instance to use. *
|
Zeile 171 | Zeile 178 |
---|
*/ public $cache;
|
*/ public $cache;
|
/**
| /**
|
* The base URL to assets. * * @var string
| * The base URL to assets. * * @var string
|
Zeile 185 | Zeile 192 |
---|
const INPUT_STRING = 0; /** * Integer input constant for use with get_input().
|
const INPUT_STRING = 0; /** * Integer input constant for use with get_input().
|
* * @see get_input */
| * * @see get_input */
|
const INPUT_INT = 1; /** * Array input constant for use with get_input().
|
const INPUT_INT = 1; /** * Array input constant for use with get_input().
|
* * @see get_input */
| * * @see get_input */
|
const INPUT_ARRAY = 2; /** * Float input constant for use with get_input().
| const INPUT_ARRAY = 2; /** * Float input constant for use with get_input().
|
Zeile 207 | Zeile 214 |
---|
* @see get_input */ const INPUT_BOOL = 4;
|
* @see get_input */ const INPUT_BOOL = 4;
|
|
|
/** * Constructor of class.
|
/** * Constructor of class.
|
* * @return MyBB
| |
*/ function __construct() {
| */ function __construct() {
|
Zeile 222 | Zeile 227 |
---|
if(isset($_POST[$var]) || isset($_GET[$var]) || isset($_COOKIE[$var]) || isset($_FILES[$var])) { die("Hacking attempt");
|
if(isset($_POST[$var]) || isset($_GET[$var]) || isset($_COOKIE[$var]) || isset($_FILES[$var])) { die("Hacking attempt");
|
} }
| } }
|
if(defined("IGNORE_CLEAN_VARS")) { if(!is_array(IGNORE_CLEAN_VARS)) { $this->ignore_clean_variables = array(IGNORE_CLEAN_VARS);
|
if(defined("IGNORE_CLEAN_VARS")) { if(!is_array(IGNORE_CLEAN_VARS)) { $this->ignore_clean_variables = array(IGNORE_CLEAN_VARS);
|
}
| }
|
else { $this->ignore_clean_variables = IGNORE_CLEAN_VARS;
| else { $this->ignore_clean_variables = IGNORE_CLEAN_VARS;
|
Zeile 259 | Zeile 264 |
---|
if($_SERVER['REQUEST_METHOD'] == "POST") { $this->request_method = "post";
|
if($_SERVER['REQUEST_METHOD'] == "POST") { $this->request_method = "post";
|
}
| }
|
else if($_SERVER['REQUEST_METHOD'] == "GET")
|
else if($_SERVER['REQUEST_METHOD'] == "GET")
|
{
| {
|
$this->request_method = "get"; }
// If we've got register globals on, then kill them too if(@ini_get("register_globals") == 1)
|
$this->request_method = "get"; }
// If we've got register globals on, then kill them too if(@ini_get("register_globals") == 1)
|
{
| {
|
$this->unset_globals($_POST); $this->unset_globals($_GET); $this->unset_globals($_FILES);
| $this->unset_globals($_POST); $this->unset_globals($_GET); $this->unset_globals($_FILES);
|
Zeile 308 | Zeile 313 |
---|
/** * Parses the incoming variables. *
|
/** * Parses the incoming variables. *
|
* @param array The array of incoming variables.
| * @param array $array The array of incoming variables.
|
*/ function parse_incoming($array) {
| */ function parse_incoming($array) {
|
Zeile 360 | Zeile 365 |
---|
/** * Strips slashes out of a given array. *
|
/** * Strips slashes out of a given array. *
|
* @param array The array to strip.
| * @param array $array The array to strip.
|
*/ function strip_slashes_array(&$array) {
| */ function strip_slashes_array(&$array) {
|
Zeile 380 | Zeile 385 |
---|
/** * Unsets globals from a specific array. *
|
/** * Unsets globals from a specific array. *
|
* @param array The array to unset from.
| * @param array $array The array to unset from.
|
*/ function unset_globals($array) { if(!is_array($array)) { return;
|
*/ function unset_globals($array) { if(!is_array($array)) { return;
|
}
| }
|
foreach(array_keys($array) as $key) { unset($GLOBALS[$key]); unset($GLOBALS[$key]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
|
foreach(array_keys($array) as $key) { unset($GLOBALS[$key]); unset($GLOBALS[$key]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
|
} }
/**
| } }
/**
|
* Cleans predefined input variables. * */ function clean_input() { foreach($this->clean_variables as $type => $variables)
|
* Cleans predefined input variables. * */ function clean_input() { foreach($this->clean_variables as $type => $variables)
|
{
| {
|
foreach($variables as $var) { // If this variable is in the ignored array, skip and move to next. if(in_array($var, $this->ignore_clean_variables)) { continue;
|
foreach($variables as $var) { // If this variable is in the ignored array, skip and move to next. if(in_array($var, $this->ignore_clean_variables)) { continue;
|
}
| }
|
if(isset($this->input[$var])) { switch($type) { case "int":
|
if(isset($this->input[$var])) { switch($type) { case "int":
|
$this->input[$var] = $this->get_input($var, 1);
| $this->input[$var] = $this->get_input($var, MyBB::INPUT_INT);
|
break; case "a-z": $this->input[$var] = preg_replace("#[^a-z\.\-_]#i", "", $this->get_input($var));
| break; case "a-z": $this->input[$var] = preg_replace("#[^a-z\.\-_]#i", "", $this->get_input($var));
|
Zeile 434 | Zeile 439 |
---|
/** * Checks the input data type before usage.
|
/** * Checks the input data type before usage.
|
*
| *
|
* @param string $name Variable name ($mybb->input) * @param int $type The type of the variable to get. Should be one of MyBB::INPUT_INT, MyBB::INPUT_ARRAY or MyBB::INPUT_STRING. *
|
* @param string $name Variable name ($mybb->input) * @param int $type The type of the variable to get. Should be one of MyBB::INPUT_INT, MyBB::INPUT_ARRAY or MyBB::INPUT_STRING. *
|
* @return mixed Checked data
| * @return int|float|array|string Checked data. Type depending on $type
|
*/ function get_input($name, $type = MyBB::INPUT_STRING) {
| */ function get_input($name, $type = MyBB::INPUT_STRING) {
|
Zeile 448 | Zeile 453 |
---|
if(!isset($this->input[$name]) || !is_array($this->input[$name])) { return array();
|
if(!isset($this->input[$name]) || !is_array($this->input[$name])) { return array();
|
} return $this->input[$name];
| } return $this->input[$name];
|
case MyBB::INPUT_INT: if(!isset($this->input[$name]) || !is_numeric($this->input[$name])) {
| case MyBB::INPUT_INT: if(!isset($this->input[$name]) || !is_numeric($this->input[$name])) {
|
Zeile 497 | Zeile 502 |
---|
$path = substr($path, 2); }
|
$path = substr($path, 2); }
|
$base_path = '';
| |
if($use_cdn && $this->settings['usecdn'] && !empty($this->settings['cdnurl'])) { $base_path = rtrim($this->settings['cdnurl'], '/');
| if($use_cdn && $this->settings['usecdn'] && !empty($this->settings['cdnurl'])) { $base_path = rtrim($this->settings['cdnurl'], '/');
|
Zeile 525 | Zeile 529 |
---|
/** * Triggers a generic error. *
|
/** * Triggers a generic error. *
|
* @param string The error code.
| * @param string $code The error code.
|
*/ function trigger_generic_error($code) {
| */ function trigger_generic_error($code) {
|
Zeile 550 | Zeile 554 |
---|
$error_code = MYBB_NOT_UPGRADED; break; case "sql_load_error":
|
$error_code = MYBB_NOT_UPGRADED; break; case "sql_load_error":
|
$message = "MyBB was unable to load the SQL extension. Please contact the MyBB Group for support. <a href=\"http://www.mybb.com\">MyBB Website</a>";
| $message = "MyBB was unable to load the SQL extension. Please contact the MyBB Group for support. <a href=\"https://mybb.com\">MyBB Website</a>";
|
$error_code = MYBB_SQL_LOAD_ERROR; break; case "apc_load_error": $message = "APC needs to be configured with PHP to use the APC cache support.";
|
$error_code = MYBB_SQL_LOAD_ERROR; break; case "apc_load_error": $message = "APC needs to be configured with PHP to use the APC cache support.";
|
| $error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; case "apcu_load_error": $message = "APCu needs to be configured with PHP to use the APCu cache support.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; case "eaccelerator_load_error": $message = "eAccelerator needs to be configured with PHP to use the eAccelerator cache support.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; case "eaccelerator_load_error": $message = "eAccelerator needs to be configured with PHP to use the eAccelerator cache support.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break;
| $error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break;
|
case "memcache_load_error": $message = "Your server does not have memcache support enabled.";
|
case "memcache_load_error": $message = "Your server does not have memcache support enabled.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR;
| $error_code = MYBB_CACHEHANDLER_LOAD_ERROR;
|
break; case "memcached_load_error": $message = "Your server does not have memcached support enabled.";
|
break; case "memcached_load_error": $message = "Your server does not have memcached support enabled.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR;
| $error_code = MYBB_CACHEHANDLER_LOAD_ERROR;
|
break; case "xcache_load_error": $message = "Xcache needs to be configured with PHP to use the Xcache cache support.";
|
break; case "xcache_load_error": $message = "Xcache needs to be configured with PHP to use the Xcache cache support.";
|
| $error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; case "redis_load_error": $message = "Your server does not have redis support enabled.";
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; default:
|
$error_code = MYBB_CACHEHANDLER_LOAD_ERROR; break; default:
|
$message = "MyBB has experienced an internal error. Please contact the MyBB Group for support. <a href=\"http://www.mybb.com\">MyBB Website</a>";
| $message = "MyBB has experienced an internal error. Please contact the MyBB Group for support. <a href=\"https://mybb.com\">MyBB Website</a>";
|
$error_code = MYBB_GENERAL; } $error_handler->trigger($message, $error_code);
| $error_code = MYBB_GENERAL; } $error_handler->trigger($message, $error_code);
|
Zeile 595 | Zeile 607 |
---|
*/
$grouppermignore = array("gid", "type", "title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
|
*/
$grouppermignore = array("gid", "type", "title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
|
$groupzerogreater = array("pmquota", "maxpmrecipients", "maxreputationsday", "attachquota", "maxemails", "maxwarningsday", "maxposts", "edittimelimit", "canusesigxposts", "maxreputationsperthread", "emailfloodtime");
| $groupzerogreater = array("pmquota", "maxpmrecipients", "maxreputationsday", "attachquota", "maxemails", "maxposts", "edittimelimit", "maxreputationsperuser", "maxreputationsperthread", "emailfloodtime");
|
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
// These are fields in the usergroups table that are also forum permission specific.
| $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
// These are fields in the usergroups table that are also forum permission specific.
|
Zeile 611 | Zeile 623 |
---|
'candeleteposts', 'candeletethreads', 'caneditattachments',
|
'candeleteposts', 'candeletethreads', 'caneditattachments',
|
| 'canviewdeletionnotice',
|
'modposts', 'modthreads', 'modattachments',
| 'modposts', 'modthreads', 'modattachments',
|