Vergleich inc/class_core.php - 1.8.0 - 1.8.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 14Zeile 14
	 *
* @var string
*/

	 *
* @var string
*/

	public $version = "1.8.0";

	public $version = "1.8.5";


/**
* 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 = 1805;


/**
* The current working directory.


/**
* The current working directory.

Zeile 160Zeile 160
		'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 176Zeile 177
	 * @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.

Zeile 188Zeile 219
		$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 236Zeile 267

// If we've got register globals on, then kill them too
if(@ini_get("register_globals") == 1)


// 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 248Zeile 279
		if($safe_mode_status == 1 || strtolower($safe_mode_status) == 'on')
{
$this->safemode = true;

		if($safe_mode_status == 1 || strtolower($safe_mode_status) == 'on')
{
$this->safemode = true;

		}

		}


// Are we running on a development server?
if(isset($_SERVER['MYBB_DEV_MODE']) && $_SERVER['MYBB_DEV_MODE'] == 1)
{
$this->dev_mode = 1;


// Are we running on a development server?
if(isset($_SERVER['MYBB_DEV_MODE']) && $_SERVER['MYBB_DEV_MODE'] == 1)
{
$this->dev_mode = 1;

		}


		}


		// Are we running in debug mode?
if(isset($this->input['debug']) && $this->input['debug'] == 1)
{

		// Are we running in debug mode?
if(isset($this->input['debug']) && $this->input['debug'] == 1)
{

Zeile 266Zeile 297
		{
require_once dirname(__FILE__)."/mybb_group.php";
output_logo();

		{
require_once dirname(__FILE__)."/mybb_group.php";
output_logo();

		}

		}


if(isset($this->input['intcheck']) && $this->input['intcheck'] == 1)
{


if(isset($this->input['intcheck']) && $this->input['intcheck'] == 1)
{

Zeile 322Zeile 353
			if(empty($this->cookies[$key]))
{
$this->cookies[$key] = $val;

			if(empty($this->cookies[$key]))
{
$this->cookies[$key] = $val;

			}
}
}

/**

			}
}
}

/**

	 * Strips slashes out of a given array.
*
* @param array The array to strip.

	 * Strips slashes out of a given array.
*
* @param array The array to strip.

	 */

	 */

	function strip_slashes_array(&$array)
{
foreach($array as $key => $val)

	function strip_slashes_array(&$array)
{
foreach($array as $key => $val)

		{

		{

			if(is_array($array[$key]))
{
$this->strip_slashes_array($array[$key]);

			if(is_array($array[$key]))
{
$this->strip_slashes_array($array[$key]);

			}

			}

			else
{
$array[$key] = stripslashes($array[$key]);

			else
{
$array[$key] = stripslashes($array[$key]);

Zeile 356Zeile 387
		if(!is_array($array))
{
return;

		if(!is_array($array))
{
return;

		}

		}


foreach(array_keys($array) as $key)
{


foreach(array_keys($array) as $key)
{

Zeile 364Zeile 395
			unset($GLOBALS[$key]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
}
}

			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.
*

	/**
* Cleans predefined input variables.
*

Zeile 386Zeile 417
					switch($type)
{
case "int":

					switch($type)
{
case "int":

							$this->input[$var] = $this->get_input($var, 1);
break;

							$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));
break;

Zeile 404Zeile 435
	/**
* 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 mixed Checked data

	 */

	 */

	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]))
{
return array();
}
return $this->input[$name];

				if(!isset($this->input[$name]) || !is_array($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 453Zeile 497
				$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'], '/');