Disable flash uploader if mac and mod_security is enabled. Props andy. fixes #6278

git-svn-id: http://svn.automattic.com/wordpress/trunk@7396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-19 06:18:05 +00:00
parent f704e592a9
commit 6acfc685e6
1 changed files with 9 additions and 0 deletions

View File

@ -778,6 +778,12 @@ function media_upload_form( $errors = null ) {
$flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
// If Mac and mod_security, no Flash. :(
if ( false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && 'on' == strtolower(apache_getenv('MODSEC_ENABLE')) )
$flash = false;
else
$flash = true;
$post_id = intval($_REQUEST['post_id']);
?>
@ -787,6 +793,7 @@ function media_upload_form( $errors = null ) {
<?php echo $errors['upload_error']->get_error_message(); ?>
<?php } ?>
</div>
<?php if ( $flash ) : ?>
<script type="text/javascript">
<!--
jQuery(function($){
@ -828,6 +835,8 @@ jQuery(function($){
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div>
<?php endif; // $flash ?>
<div id="html-upload-ui">
<p>
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a>