annotate wiki/htdocs/applets/FCKeditor/editor/filemanager/connectors/php/upload.php @ 5130:287faf79876f

upgrade FCKeditor from 2.6.4 to 2.6.4.1 (security update, see comments below) The security issue fixed in 2.6.4.1 had no relevance to the FCKeditor features used by MoinMoin. Thus we were not in a hurry to incorporate this and push out a new moin release with it. But as a new moin release is pending now anyway, we include the latest FCKeditor release now anyway, just to have everything up-to-date. :)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Sep 2009 15:12:11 +0200
parents 1d37117f8ca6
children
rev   line source
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
1 <?php
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
2 /*
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4545
1d37117f8ca6 updated FCKeditor to 2.6.4
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3954
diff changeset
4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
5 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
6 * == BEGIN LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
7 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
8 * Licensed under the terms of any of the following licenses at your
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
9 * choice:
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
10 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
11 * - GNU General Public License Version 2 or later (the "GPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
12 * http://www.gnu.org/licenses/gpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
13 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
15 * http://www.gnu.org/licenses/lgpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
16 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
18 * http://www.mozilla.org/MPL/MPL-1.1.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
19 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
20 * == END LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
21 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
22 * This is the "File Uploader" for PHP.
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
23 */
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
24
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
25 require('./config.php') ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
26 require('./util.php') ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
27 require('./io.php') ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
28 require('./commands.php') ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
29 require('./phpcompat.php') ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
30
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
31 function SendError( $number, $text )
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
32 {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
33 SendUploadResults( $number, '', '', $text ) ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
34 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
35
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
36
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
37 // Check if this uploader has been enabled.
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
38 if ( !$Config['Enabled'] )
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
39 SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
40
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
41 $sCommand = 'QuickUpload' ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
42
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
43 // The file type (from the QueryString, by default 'File').
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
44 $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
45
5130
287faf79876f upgrade FCKeditor from 2.6.4 to 2.6.4.1 (security update, see comments below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4545
diff changeset
46 $sCurrentFolder = "/" ;
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
47
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
48 // Is enabled the upload?
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
49 if ( ! IsAllowedCommand( $sCommand ) )
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
50 SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' ) ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
51
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
52 // Check if it is an allowed type.
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
53 if ( !IsAllowedType( $sType ) )
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
54 SendUploadResults( 1, '', '', 'Invalid type specified' ) ;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
55
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
56
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
57 FileUpload( $sType, $sCurrentFolder, $sCommand )
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
58
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
59 ?>