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

git-svn-id: https://develop.svn.wordpress.org/trunk@19494 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-11-30 21:05:22 +00:00
parent c754f4636f
commit 8b90f3c7e5

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>