Changeset 1097

Show
Ignore:
Timestamp:
05/20/08 00:54:50 (7 months ago)
Author:
_ck_
Message:

additional check to handle empty $_FILES

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bb-attachments/trunk/bb-attachments.php

    r1080 r1097  
    206206if (!$post_id) {$post_id=intval($_GET['bb_attachments']);}      // only can upload if user is allowed to edit post 
    207207$user_id=bb_get_current_user_info( 'id' ); 
    208 if (!$user_id || !$post_id || !bb_current_user_can('edit_post',$post_id) || !bb_current_user_can($bb_attachments['role']['upload'])) {return;}         
    209  
    210 $user_ip=$_SERVER["REMOTE_ADDR"];  // $GLOBALS["HTTP_SERVER_VARS"]["REMOTE_ADDR"]; 
     208if (!isset($_FILES) || !is_array($_FILES) || !$user_id || !$post_id || !bb_current_user_can('edit_post',$post_id) || !bb_current_user_can($bb_attachments['role']['upload'])) {return;}        
     209 
     210$user_ip=$_SERVER["REMOTE_ADDR"];      // $GLOBALS["HTTP_SERVER_VARS"]["REMOTE_ADDR"]; 
    211211$time=time();                                            
    212212