Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

+101 -98
View File
@@ -1,18 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Upload handler : Handles $_FILES and checks for security
* Last Updated: $Date: 2009-02-23 17:45:20 -0500 (Mon, 23 Feb 2009) $
* Last Updated: $Date: 2010-04-14 19:25:39 -0400 (Wed, 14 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Services Kernel
* @link http://www.iinvisionpower.com
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Kernel
* @link http://www.invisionpower.com
* @since 15th March 2004
* @version $Revision: 229 $
* @version $Revision: 389 $
*
*
* Example Usage:
@@ -57,149 +60,149 @@
class classUpload
{
/**
* Name of upload form field
*
* @access public
* @var string
*/
* Name of upload form field
*
* @access public
* @var string
*/
public $upload_form_field = 'FILE_UPLOAD';
/**
* Out filename *without* extension
* (Leave blank to retain user filename)
*
* @access public
* @var string
*/
* Out filename *without* extension
* (Leave blank to retain user filename)
*
* @access public
* @var string
*/
public $out_file_name = '';
/**
* Out dir (./upload) - no trailing slash
*
* @access public
* @var string
*/
* Out dir (./upload) - no trailing slash
*
* @access public
* @var string
*/
public $out_file_dir = './';
/**
* Maximum file size of this upload
*
* @access public
* @var integer
*/
* Maximum file size of this upload
*
* @access public
* @var integer
*/
public $max_file_size = 0;
/**
* Forces PHP, CGI, etc to text
*
* @access public
* @var integer
*/
* Forces PHP, CGI, etc to text
*
* @access public
* @var integer
*/
public $make_script_safe = 1;
/**
* Force non-img file extenstion (leave blank if not) (ex: 'ibf' makes upload.doc => upload.ibf)
*
* @access public
* @var string
*/
* Force non-img file extenstion (leave blank if not) (ex: 'ibf' makes upload.doc => upload.ibf)
*
* @access public
* @var string
*/
public $force_data_ext = '';
/**
* Allowed file extensions array( 'gif', 'jpg', 'jpeg'..)
*
* @access public
* @var array
*/
* Allowed file extensions array( 'gif', 'jpg', 'jpeg'..)
*
* @access public
* @var array
*/
public $allowed_file_ext = array();
/**
* Check file extension allowed
*
* @access public
* @var boolean
*/
* Check file extension allowed
*
* @access public
* @var boolean
*/
public $check_file_ext = true;
/**
* Array of IMAGE file extensions
*
* @access public
* @var array
*/
* Array of IMAGE file extensions
*
* @access public
* @var array
*/
public $image_ext = array( 'gif', 'jpeg', 'jpg', 'jpe', 'png' );
/**
* Check to make sure an image is an image
*
* @access public
* @var boolean
*/
* Check to make sure an image is an image
*
* @access public
* @var boolean
*/
public $image_check = true;
/**
* Returns current file extension
*
* @access public
* @var string
*/
* Returns current file extension
*
* @access public
* @var string
*/
public $file_extension = '';
/**
* If force_data_ext == 1, this will return the 'real' extension
* and $file_extension will return the 'force_data_ext'
*
* @access public
* @var string
*/
* If force_data_ext == 1, this will return the 'real' extension
* and $file_extension will return the 'force_data_ext'
*
* @access public
* @var string
*/
public $real_file_extension = '';
/**
* Returns error number [1-5]
*
* @access public
* @var integer
*/
* Returns error number [1-5]
*
* @access public
* @var integer
*/
public $error_no = 0;
/**
* Returns if upload is img or not
*
* @access public
* @var boolean
*/
* Returns if upload is img or not
*
* @access public
* @var boolean
*/
public $is_image = 0;
/**
* Returns file name as was uploaded by user
*
* @access public
* @var string
*/
* Returns file name as was uploaded by user
*
* @access public
* @var string
*/
public $original_file_name = "";
/**
* Returns final file name as is saved on disk. (no path info)
*
* @access public
* @var string
*/
* Returns final file name as is saved on disk. (no path info)
*
* @access public
* @var string
*/
public $parsed_file_name = "";
/**
* Returns final file name with path info
*
* @access public
* @var string
*/
* Returns final file name with path info
*
* @access public
* @var string
*/
public $saved_upload_name = "";
/**
* Processes the upload
*
* @access public
* @return boolean Upload successful
*/
* Processes the upload
*
* @access public
* @return boolean Upload successful
*/
public function process()
{
$this->_cleanPaths();