Sanitize options for resizing in the uploader, props mhauan, nacin, fixes #19399

git-svn-id: http://svn.automattic.com/wordpress/trunk@19494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-30 21:05:22 +00:00
parent 5b248a72c8
commit 5ec6bd4833
1 changed files with 10 additions and 1 deletions

View File

@ -1350,7 +1350,16 @@ $plupload_init = apply_filters( 'plupload_init', $plupload_init );
?>
<script type="text/javascript">
var resize_height = <?php echo get_option('large_size_h', 1024); ?>, resize_width = <?php echo get_option('large_size_w', 1024); ?>,
<?php
// Verify size is an int. If not return default value.
$large_size_h = absint( get_option('large_size_h') );
if( !$large_size_h )
$large_size_h = 1024;
$large_size_w = absint( get_option('large_size_w') );
if( !$large_size_w )
$large_size_w = 1024;
?>
var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,
wpUploaderInit = <?php echo json_encode($plupload_init); ?>;
</script>