Subversion Repositories pub

Rev

Rev 71 | Details | Compare with Previous | Last modification | View Log | SVN

Rev Author Line No. Line
70 toni 1
<?php
2
/*
3
Plugin Name: Allow dangeours uploads
4
Plugin URI: http://p.outlyer.net/wordpress/
5
Description: Re-allow the upload of exe and swf files, a capability removed for security reasons (cross-site scripting) in WordPress 3.6.1. See <a href="http://codex.wordpress.org/Version_3.6.1">wordpress 3.6.1 release notes</a>
6
Version: 1
7
Author: Toni Corvera
8
Author URI: http://corvera.eu
9
*/
10
 
11
/*
12
 * Copyright 2013  Toni Corvera <outlyer@gmail.com>
13
 *
14
 * This program is free software; you can redistribute it and/or
15
 * modify it under the terms of the GNU Lesser General Public
16
 * License as published by the Free Software Foundation; either
17
 * version 2.1 of the License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22
 * Lesser General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU Lesser General Public
25
 * License along with this library; if not, write to the Free Software
26
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
27
 */
28
 
29
add_filter('upload_mimes', 'net_outlyer_uns_upload_mime');
30
 
31
/**
32
 * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
33
 */
34
function net_outlyer_uns_upload_mime($existing_mimes = array()) {
35
	//if (get_option('allow_swf_upload') == 1)
36
	if (!isset($existing_mimes['swf'])) {
37
		$existing_mimes['swf'] = 'application/x-shockwave-flash';
38
	}
39
	if (!isset($existing_mimes['exe'])) {
40
		$existing_mimes['exe'] = 'application/x-dosexec';
41
	}
42
	return $existing_mimes;
43
}
44
 
45
 
46
// vim:set ts=4 noet ai: //?>