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:
parent
1b27039e81
commit
1107f63d47
|
@ -778,6 +778,12 @@ function media_upload_form( $errors = null ) {
|
||||||
|
|
||||||
$flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
|
$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']);
|
$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 echo $errors['upload_error']->get_error_message(); ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ( $flash ) : ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
|
@ -828,6 +835,8 @@ jQuery(function($){
|
||||||
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
|
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php endif; // $flash ?>
|
||||||
|
|
||||||
<div id="html-upload-ui">
|
<div id="html-upload-ui">
|
||||||
<p>
|
<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>
|
<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>
|
||||||
|
|
Loading…
Reference in New Issue