phpBB

Code Changes

File: phpbb/files/upload.php

  Unmodified   Added   Modified   Removed
Line 261Line 261
	 *
* @param filespec $file Instance of filespec class
*/

	 *
* @param filespec $file Instance of filespec class
*/

	public function common_checks(&$file)

	public function common_checks($file)

	{
// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))

	{
// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))

Line 297Line 297
	 *
* @return bool True if extension is allowed, false if not
*/

	 *
* @return bool True if extension is allowed, false if not
*/

	public function valid_extension(&$file)

	public function valid_extension($file)

	{
return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false;
}

	{
return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false;
}

Line 310Line 310
	 * @return bool True if dimensions are valid or no constraints set, false
* if not
*/

	 * @return bool True if dimensions are valid or no constraints set, false
* if not
*/

	public function valid_dimensions(&$file)

	public function valid_dimensions($file)

	{
if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height)
{

	{
if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height)
{

Line 350Line 350
	 *
* @return bool True if content is valid, false if not
*/

	 *
* @return bool True if content is valid, false if not
*/

	public function valid_content(&$file)

	public function valid_content($file)

	{
return ($file->check_content($this->disallowed_content));
}

	{
return ($file->check_content($this->disallowed_content));
}