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

git-svn-id: https://develop.svn.wordpress.org/trunk@7396 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-19 06:18:05 +00:00
parent 1b27039e81
commit 1107f63d47
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>