WordPress.org

Make WordPress Core

Ticket #6278: 6278.diff

File 6278.diff, 1.1 KB (added by andy, 14 years ago)

if it looks like a mac and mod_security is on, cripple flash uploader

  • wp-admin/includes/media.php

     
    778778
    779779        $flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
    780780
     781        // If Mac and mod_security, no Flash. :(
     782        if ( false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && 'on' == strtolower(apache_getenv('MODSEC_ENABLE')) )
     783                $flash = false;
     784        else
     785                $flash = true;
     786
    781787        $post_id = intval($_REQUEST['post_id']);
    782788
    783789?>
     
    787793        <?php echo $errors['upload_error']->get_error_message(); ?>
    788794<?php } ?>
    789795</div>
     796<?php if ( $flash ) : ?>
    790797<script type="text/javascript">
    791798<!--
    792799jQuery(function($){
     
    828835        <p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
    829836</div>
    830837
     838<?php endif; // $flash ?>
     839
    831840<div id="html-upload-ui">
    832841        <p>
    833842        <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>