Changeset 1014
- Timestamp:
- 04/26/08 13:28:23 (7 months ago)
- Files:
-
- bb-attachments/trunk/bb-attachments.php (modified) (3 diffs)
- bb-attachments/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-attachments/trunk/bb-attachments.php
r996 r1014 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.0. 68 Version: 0.0.7 9 9 10 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ … … 241 241 242 242 $file=$dir."/".$id.".".$filename; 243 244 // file is commited here 243 245 244 if (!$failed && $id>0 && @ copy($_FILES['bb_attachments']['tmp_name'][$key], $file)) { // file is commited here246 if (!$failed && $id>0 && @is_uploaded_file($_FILES['bb_attachments']['tmp_name'][$key]) && @move_uploaded_file($_FILES['bb_attachments']['tmp_name'][$key], $file)) { 245 247 chmod("$file",0777); 246 248 $count++; $offset++; // count how many successfully uploaded this time 247 249 } else { 248 $status=2; // failed - not necessarily user's fault 250 $status=2; // failed - not necessarily user's fault, could be filesystem 249 251 } 250 252 … … 409 411 } 410 412 411 if ( ! function_exists ( 'mime_content_type' ) ) { // most newer PHP doesn't have this, so try shell ? 412 function mime_content_type ( $f ) {return trim (@exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;} 413 if ( ! function_exists ( 'mime_content_type' ) ) { // most newer PHP doesn't have this 414 415 if (function_exists('finfo_open') && function_exists('finfo_file')) { // try finfo 416 417 function mime_content_type( $f ) {$finfo=finfo_open(FILEINFO_MIME); return trim(finfo_file($finfo, $f));} 418 419 } else { // so try shell ? - will fail on windows 100% of the time 420 421 function mime_content_type( $f ) {return trim (@exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;} 422 } 413 423 } 414 424 bb-attachments/trunk/readme.txt
r996 r1014 48 48 * 0.0.5 first public beta release for review 49 49 * 0.0.6 advanced restrictions by file type & user role, upload form displays allowed file types 50 * 0.0.7 one more mime option for windows/no-shell-access users 50 51 51 52 == To Do ==
