<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14776] trunk/wp-admin/includes/media.php: We'
 re not as bold as some people make us out to be.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14776">14776</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-05-21 12:57:49 +0000 (Fri, 21 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>We're not as bold as some people make us out to be. Move the maximum upload size from a Heading to a paragraph text. Fix screen formatting on Multisite when over quota. see <a href="http://trac.wordpress.org/ticket/12853">#12853</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (14775 => 14776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2010-05-21 03:31:35 UTC (rev 14775)
+++ trunk/wp-admin/includes/media.php        2010-05-21 12:57:49 UTC (rev 14776)
</span><span class="lines">@@ -1400,6 +1400,16 @@
</span><span class="cx">         $flash = apply_filters('flash_uploader', $flash);
</span><span class="cx">         $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
</span><span class="cx"> 
</span><ins>+        $upload_size_unit = $max_upload_size =  wp_max_upload_size();
+        $sizes = array( 'KB', 'MB', 'GB' );
+        for ( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $sizes ) - 1; $u++ )
+                $upload_size_unit /= 1024;
+        if ( $u &lt; 0 ) {
+                $upload_size_unit = 0;
+                $u = 0;
+        } else {
+                $upload_size_unit = (int) $upload_size_unit;
+        }
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx"> //&lt;![CDATA[
</span><span class="lines">@@ -1421,26 +1431,12 @@
</span><span class="cx">         &lt;?php echo $errors['upload_error']-&gt;get_error_message(); ?&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><del>-&lt;div id=&quot;media-upload-size&quot;&gt;
-&lt;?php 
-        $upload_size_unit = $max_upload_size =  wp_max_upload_size();
-        $sizes = array( 'KB', 'MB', 'GB' );
-        for( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $sizes ) - 1; $u++ )
-                $upload_size_unit /= 1024;
-        if ( $u &lt; 0 ) {
-                $upload_size_unit = 0;
-                $u = 0;
-        } else {
-                $upload_size_unit = (int) $upload_size_unit;
-        }
-        printf( '&lt;h3&gt;' . __( 'Maximum upload file size: %d%s' ) . '&lt;/h3&gt;', $upload_size_unit, $sizes[$u] );
-?&gt;
-&lt;/div&gt;
-
</del><span class="cx"> &lt;?php
</span><span class="cx"> // Check quota for this blog if multisite
</span><del>-if ( is_multisite() &amp;&amp; !is_upload_space_available() )
-        wp_die( __('Sorry, you must delete files before you can upload any more.') );
</del><ins>+if ( is_multisite() &amp;&amp; !is_upload_space_available() ) {
+        echo '&lt;p&gt;' . __('Sorry, you must delete files before you can upload any more.') . '&lt;/p&gt;';
+        return;
+}
</ins><span class="cx"> 
</span><span class="cx"> do_action('pre-upload-ui');
</span><span class="cx"> 
</span><span class="lines">@@ -1463,7 +1459,7 @@
</span><span class="cx">                         file_types: &quot;&lt;?php echo apply_filters('upload_file_glob', '*.*'); ?&gt;&quot;,
</span><span class="cx">                         post_params : {
</span><span class="cx">                                 &quot;post_id&quot; : &quot;&lt;?php echo $post_id; ?&gt;&quot;,
</span><del>-                                &quot;auth_cookie&quot; : &quot;&lt;?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?&gt;&quot;,
</del><ins>+                                &quot;auth_cookie&quot; : &quot;&lt;?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?&gt;&quot;,
</ins><span class="cx">                                 &quot;logged_in_cookie&quot;: &quot;&lt;?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?&gt;&quot;,
</span><span class="cx">                                 &quot;_wpnonce&quot; : &quot;&lt;?php echo wp_create_nonce('media-form'); ?&gt;&quot;,
</span><span class="cx">                                 &quot;type&quot; : &quot;&lt;?php echo $type; ?&gt;&quot;,
</span><span class="lines">@@ -1499,8 +1495,9 @@
</span><span class="cx">         &lt;div&gt;
</span><span class="cx">         &lt;?php _e( 'Choose files to upload' ); ?&gt;
</span><span class="cx">         &lt;div id=&quot;flash-browse-button&quot;&gt;&lt;/div&gt;
</span><del>-        &lt;span&gt;&lt;input id=&quot;cancel-upload&quot; disabled=&quot;disabled&quot; onclick=&quot;cancelUpload()&quot; type=&quot;button&quot; value=&quot;&lt;?php esc_attr_e('Cancel Upload'); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;/span&gt;
</del><ins>+        &lt;span&gt;&lt;input id=&quot;cancel-upload&quot; disabled=&quot;disabled&quot; onClick=&quot;cancelUpload()&quot; type=&quot;button&quot; value=&quot;&lt;?php esc_attr_e('Cancel Upload'); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;/span&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><ins>+        &lt;p class=&quot;media-upload-size&quot;&gt;&lt;?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?&gt;&lt;/p&gt;
</ins><span class="cx"> &lt;?php do_action('post-flash-upload-ui'); ?&gt;
</span><span class="cx">         &lt;p class=&quot;howto&quot;&gt;&lt;?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?&gt;&lt;/p&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="lines">@@ -1513,6 +1510,7 @@
</span><span class="cx">         &lt;input type=&quot;file&quot; name=&quot;async-upload&quot; id=&quot;async-upload&quot; /&gt; &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;html-upload&quot; value=&quot;&lt;?php esc_attr_e('Upload'); ?&gt;&quot; /&gt; &lt;a href=&quot;#&quot; onclick=&quot;try{top.tb_remove();}catch(e){}; return false;&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
</span><span class="cx">         &lt;/p&gt;
</span><span class="cx">         &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</span><ins>+        &lt;p class=&quot;media-upload-size&quot;&gt;&lt;?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?&gt;&lt;/p&gt;
</ins><span class="cx">         &lt;?php if ( is_lighttpd_before_150() ): ?&gt;
</span><span class="cx">         &lt;p&gt;&lt;?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?&gt;&lt;/p&gt;
</span><span class="cx">         &lt;?php endif;?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>