Zeile 14 | Zeile 14 |
---|
* * @var string */
|
* * @var string */
|
public $version = "1.8.0";
| public $version = "1.8.6";
|
/** * The version code of MyBB we're running. * * @var integer */
|
/** * The version code of MyBB we're running. * * @var integer */
|
public $version_code = 1800;
| public $version_code = 1806;
|
/** * 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 = "";
|
*/ public $request_method = "";
|
/**
| /**
|
* Whether or not PHP's safe_mode is enabled * * @var boolean
| * Whether or not PHP's safe_mode is enabled * * @var boolean
|
Zeile 128 | Zeile 128 |
---|
"a-z" => array( "sortby", "order" )
|
"a-z" => array( "sortby", "order" )
|
);
/**
| );
/**
|
* Variables that are to be ignored from cleansing process
|
* Variables that are to be ignored from cleansing process
|
* * @var array
| * * @var array
|
*/ public $ignore_clean_variables = 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;
|
public $use_shutdown = true;
|
/**
| /**
|
* Debug mode?
|
* 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),
| */ public $binary_fields = array( 'adminlog' => array('ipaddress' => true),
|
Zeile 160 | Zeile 166 |
---|
'searchlog' => array('ipaddress' => true), 'sessions' => array('ip' => true), 'threadratings' => array('ipaddress' => true),
|
'searchlog' => array('ipaddress' => true), 'sessions' => array('ip' => true), 'threadratings' => array('ipaddress' => true),
|
'users' => array('regip' => true, 'lastip' => true)
| 'users' => array('regip' => true, 'lastip' => true), 'spamlog' => array('ipaddress' => true),
|
);
/**
| );
/**
|
Zeile 176 | Zeile 183 |
---|
* @var string */ public $asset_url = null;
|
* @var string */ public $asset_url = null;
|
| /** * String input constant for use with get_input(). * * @see get_input */ const INPUT_STRING = 0; /** * Integer input constant for use with get_input(). * * @see get_input */ const INPUT_INT = 1; /** * Array input constant for use with get_input(). * * @see get_input */ const INPUT_ARRAY = 2; /** * Float input constant for use with get_input(). * * @see get_input */ const INPUT_FLOAT = 3; /** * Boolean input constant for use with get_input(). * * @see get_input */ const INPUT_BOOL = 4;
|
/** * Constructor of class.
|
/** * Constructor of class.
|
* * @return MyBB
| |
*/ function __construct() {
| */ function __construct() {
|
Zeile 188 | Zeile 223 |
---|
$protected = array("_GET", "_POST", "_SERVER", "_COOKIE", "_FILES", "_ENV", "GLOBALS"); foreach($protected as $var) {
|
$protected = array("_GET", "_POST", "_SERVER", "_COOKIE", "_FILES", "_ENV", "GLOBALS"); foreach($protected as $var) {
|
if(isset($_REQUEST[$var]) || isset($_FILES[$var]))
| if(isset($_POST[$var]) || isset($_GET[$var]) || isset($_COOKIE[$var]) || isset($_FILES[$var]))
|
{ die("Hacking attempt"); }
| { die("Hacking attempt"); }
|
Zeile 277 | Zeile 312 |
---|
/** * 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 294 | Zeile 329 |
---|
/** * Parses the incoming cookies
|
/** * Parses the incoming cookies
|
*
| *
|
*/ function parse_cookies() {
| */ function parse_cookies() {
|
Zeile 329 | Zeile 364 |
---|
/** * 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 349 | Zeile 384 |
---|
/** * 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) {
| */ function unset_globals($array) {
|
Zeile 386 | Zeile 421 |
---|
switch($type) { case "int":
|
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 404 | Zeile 439 |
---|
/** * Checks the input data type before usage. *
|
/** * Checks the input data type before usage. *
|
* @param string Variable name ($mybb->input) * @param Data type (0/Default=String, 1=Integer, 2=Array) * @param Checked data
| * @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 int|float|array|string Checked data. Type depending on $type
|
*/
|
*/
|
function get_input($name, $type=0)
| function get_input($name, $type = MyBB::INPUT_STRING)
|
{ switch($type) {
|
{ switch($type) {
|
case 2:
| case MyBB::INPUT_ARRAY:
|
if(!isset($this->input[$name]) || !is_array($this->input[$name]))
|
if(!isset($this->input[$name]) || !is_array($this->input[$name]))
|
{
| {
|
return array(); } return $this->input[$name];
|
return array(); } return $this->input[$name];
|
case 1:
| case MyBB::INPUT_INT:
|
if(!isset($this->input[$name]) || !is_numeric($this->input[$name])) {
|
if(!isset($this->input[$name]) || !is_numeric($this->input[$name])) {
|
return 0;
| return 0; } return (int)$this->input[$name]; case MyBB::INPUT_FLOAT: if(!isset($this->input[$name]) || !is_numeric($this->input[$name])) { return 0.0; } return (float)$this->input[$name]; case MyBB::INPUT_BOOL: if(!isset($this->input[$name]) || !is_scalar($this->input[$name])) { return false;
|
}
|
}
|
return (int)$this->input[$name];
| return (bool)$this->input[$name];
|
default: if(!isset($this->input[$name]) || !is_scalar($this->input[$name])) {
| default: if(!isset($this->input[$name]) || !is_scalar($this->input[$name])) {
|
Zeile 453 | Zeile 501 |
---|
$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 481 | Zeile 528 |
---|
/** * 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) {
|