Ticket #2596: fileupload_maxk.patch
File fileupload_maxk.patch, 5.7 KB (added by , 17 years ago) |
---|
-
admin-functions.php
1853 1853 // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. 1854 1854 $upload_error_strings = array( false, 1855 1855 __( "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ), 1856 __( "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."),1856 __("The uploaded file exceeds the <em>MAX_FILE_SIZE</em> value, which can be modified in the Options/Miscellaneous tab."), 1857 1857 __( "The uploaded file was only partially uploaded." ), 1858 1858 __( "No file was uploaded." ), 1859 1859 __( "Missing a temporary folder." ), -
options-misc.php
16 16 <fieldset class="options"> 17 17 <legend><?php _e('Uploading'); ?></legend> 18 18 <table class="editform optiontable"> 19 <tr valign="top"> 19 <tr valign="top"> 20 20 <th scope="row"><?php _e('Store uploads in this folder'); ?>:</th> 21 21 <td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_option('upload_path')), 1); ?>" size="40" /> 22 22 <br /> … … 32 32 </label> 33 33 </td> 34 34 </tr> 35 <tr valign="top"> 36 <th scope="row"><?php _e('Max uploaded file size (in KB)'); ?>:</th> 37 <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" class="code" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_settings('fileupload_maxk')), 1); ?>" size="20" /> 38 </td> 39 </tr> 35 40 </table> 36 41 </fieldset> 37 42 … … 43 48 44 49 <p class="submit"> 45 50 <input type="hidden" name="action" value="update" /> 46 <input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path " />51 <input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path,fileupload_maxk" /> 47 52 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 48 53 </p> 49 54 </form> -
options.php
73 73 $value = stripslashes($value); 74 74 $value = clean_url($value); 75 75 break; 76 case 'fileupload_maxk': 77 // ensure $value is an integer 78 if(!ereg("^[0-9]+$",$value)) { 79 $value = get_settings('fileupload_maxk'); 80 } 76 81 default : 77 82 $value = stripslashes($value); 78 83 break; -
upgrade-schema.php
221 221 } else { 222 222 add_option('uploads_use_yearmonth_folders', 1); 223 223 add_option('upload_path', 'wp-content/uploads'); 224 } 224 } 225 225 226 226 // 2.0.3 227 227 add_option('secret', md5(uniqid(microtime()))); … … 230 230 add_option('blog_public', '1'); 231 231 add_option('default_link_category', 2); 232 232 add_option('show_on_front', 'posts'); 233 234 // 10MB max by default 235 add_option('fileupload_maxk','10240'); 233 236 234 237 // Delete unused options 235 238 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing'); -
upload-functions.php
134 134 <?php else : ?> 135 135 <tr> 136 136 <th scope="row"><label for="upload"><?php _e('File'); ?></label></th> 137 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_settings('fileupload_maxk')), 1) * 1024; ?>" /> 137 138 <td><input type="file" id="upload" name="image" /></td> 138 139 </tr> 139 140 <?php endif; ?> … … 151 152 <input type="submit" name="delete" id="delete" class="delete alignleft" value="<?php _e('Delete File'); ?>" /> 152 153 <?php endif; ?> 153 154 <input type="hidden" name="from_tab" value="<?php echo $tab; ?>" /> 154 <input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" /> 155 <input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" /> 155 156 <?php if ( $post_id ) : ?> 156 157 <input type="hidden" name="post_id" value="<?php echo $post_id; ?>" /> 157 158 <?php endif; if ( $id ) : ?> 158 159 <input type="hidden" name="ID" value="<?php echo $id; ?>" /> 159 160 <?php endif; ?> 160 161 <?php wp_nonce_field( 'inlineuploading' ); ?> 161 <div class="submit"> 162 <div class="submit"> 162 163 <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> »" /> 163 164 </div> 164 165 </td>