### Eclipse Workspace Patch 1.0
#P wordpress-trunk
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 14829)
+++ wp-admin/includes/template.php	(working copy)
@@ -2727,6 +2727,13 @@
 	$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
 	$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
 	$bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );
+
+	$m_bytes = wp_convert_hr_to_bytes( ini_get( 'memory_limit' ) );
+	$m_bytes = apply_filters( 'memory_limit', $m_bytes); 
+	if ($m_bytes <> -1) {
+		$bytes = min($bytes, $m_bytes);
+	}
+
 	return $bytes;
 }
 
