Changeset 1231
- Timestamp:
- 08/05/08 06:45:05 (4 months ago)
- Files:
-
- bb-attachments/trunk/bb-attachments.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-attachments/trunk/bb-attachments.php
r1230 r1231 63 63 64 64 $bb_attachments['status']=array("ok","deleted","failed","denied extension","denied mime","denied size","denied count","denied duplicate","denied dimensions"); 65 66 $bb_attachments['errors']=array("ok","uploaded file exceeds UPLOAD_MAX_FILESIZE in php.ini","uploaded file exceeds MAX_FILE_SIZE in the HTML form", 67 "uploaded file was only partially uploaded","no file was uploaded","temporary folder missing","failed to write file to disk","file upload stopped by PHP extension"); 65 68 66 69 // really stop editing! … … 259 262 // don't trust these, check after upload $_FILES['bb_attachments']['type'] $_FILES['bb_attachments']['size'] 260 263 261 $filename=trim(str_replace($strip,'_',stripslashes($value))); // sanitize filename further ??? 264 $filename=trim(str_replace($strip,'_',stripslashes($value))); // sanitize filename further ??? 262 265 263 if (intval($_FILES['bb_attachments']['error'][$key])==0 ) {264 266 if (intval($_FILES['bb_attachments']['error'][$key])==0 && $_FILES['bb_attachments']['size'][$key]>0) { 267 265 268 $ext = (strrpos($filename, '.')===false) ? "" : trim(strtolower(substr($filename, strrpos($filename, '.')+1))); 266 269 … … 326 329 if ($status>0) { 327 330 if ($id>0) {$bbdb->query("UPDATE bb_attachments SET `status` = $status WHERE `id` = $id");} 328 $output.="<li><span style='color:red'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('error:')." ".$bb_attachments['status'][$status]."</strong></span></li>"; 331 $error=""; if ($_FILES['bb_attachments']['error'][$key]>0) {$error=" (".$bb_attachments['errors'][$_FILES['bb_attachments']['error'][$key]].") ";} 332 $output.="<li><span style='color:red'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('error:')." ".$bb_attachments['status'][$status]."</strong>$error</span></li>"; 329 333 } else {$output.="<li><span style='color:green'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('successful')."</strong></span></li>";} 330 334 } // end !$empty
