Changeset 724 for trunk/app/controllers
- Timestamp:
- 08/14/08 15:21:41 (4 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/shares_controller.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/shares_controller.php
r696 r724 103 103 104 104 /** Security: checks to see if file is an image, if not do not allow upload ==*/ 105 if ( $type == "application/x-php"): // .php is not avalid file!!!105 if ( $type == 'application/x-php'): // .php is not valid file!!! 106 106 $msg = 'Error the file '. $file_name . ' is not valid. No se pueden agregar archivos .php, subelo como .txt'; 107 107 /** delete uploaded file ==*/ … … 112 112 113 113 if ( $file_size > $maxfilesize): 114 $msg = 'Error. The image is too big. Bigger than 30 MB. The current size: ' . $file_size ; 115 114 $msg = 'Error. The image is too big. Bigger than 30 MB. The current size: ' . $file_size ; 116 115 /** delete uploaded file ==*/ 117 116 unlink($file); … … 120 119 endif; 121 120 122 $conditions = array( "user_id"=> $this->Auth->user('id'));123 124 $order = "Share.id DESC";121 $conditions = array('user_id' => $this->Auth->user('id')); 122 123 $order = 'Share.id DESC'; 125 124 126 125 $current_id = $this->Share->field('id', $conditions, $order); … … 130 129 $extension = $this->get_extension($file_name); 131 130 132 $allowed = array( "pdf", "doc", "xls", "xcf", "ppt", "sxw", "odt", "odc", "ods", "odp", "abw", "html", "zip", "rar", "gz", "png", "jpg", "gif", "svg", "mp3", "ogg", "flac", "txt");131 $allowed = array('pdf', 'doc', 'xls', 'xcf', 'ppt', 'sxw', 'odt', 'odc', 'swf', 'ods', 'odp', 'abw', 'html', 'zip', 'rar', 'gz', 'png', 'jpg', 'gif', 'svg', 'mp3', 'ogg', 'flac', 'txt'); 133 132 134 133 if ( !in_array($extension, $allowed) ): 135 die( "This does not look like one allowed file ". $extension);134 die(__('This does not look like one allowed file', true) .' '. $extension); 136 135 endif; 137 136
