Update of /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv563/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php Modified Files: basexml.php commands.php config.php connector.php io.php util.php Log Message: Commiting file additions and modification from SVN revision 2028 to 2029... Changes made by frank on 2005-09-29 21:42:57 +0200 (Thu, 29 Sep 2005) corresponding to SVN revision 2029 with message: updating fckeditor in dynapi Index: connector.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** connector.php 1 Sep 2005 18:15:43 -0000 1.4 --- connector.php 29 Sep 2005 19:49:18 -0000 1.5 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 12,21 **** * This is the File Manager Connector for PHP. * - * Version: 2.0 RC3 - * Modified: 2005-02-08 11:48:55 - * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ include('config.php') ; --- 13,19 ---- * This is the File Manager Connector for PHP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ include('config.php') ; *************** *** 25,28 **** --- 23,29 ---- include('commands.php') ; + if ( !$Config['Enabled'] ) + SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/php/config.php" file' ) ; + // Get the "UserFiles" path. $GLOBALS["UserFilesPath"] = '' ; *************** *** 61,64 **** --- 62,69 ---- if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ; if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ; + + // Check for invalid folder paths (..) + if ( strpos( $sCurrentFolder, '..' ) ) + SendError( 102, "" ) ; // File Upload doesn't have to Return XML, so it must be intercepted before anything. *************** *** 69,86 **** } - // Prevent the browser from caching the result. - // Date in the past - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ; - // always modified - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ; - // HTTP/1.1 - header('Cache-Control: no-store, no-cache, must-revalidate') ; - header('Cache-Control: post-check=0, pre-check=0', false) ; - // HTTP/1.0 - header('Pragma: no-cache') ; - - // Set the response format. - header( 'Content-Type:text/xml; charset=utf-8' ) ; - CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ; --- 74,77 ---- Index: commands.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** commands.php 1 Sep 2005 18:15:43 -0000 1.4 --- commands.php 29 Sep 2005 19:49:18 -0000 1.5 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 10,21 **** * * File Name: commands.php ! * This is the File Manager Connector for ASP. ! * ! * Version: 2.0 RC3 ! * Modified: 2005-02-19 16:02:38 * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function GetFolders( $resourceType, $currentFolder ) --- 11,19 ---- * * File Name: commands.php ! * This is the File Manager Connector for PHP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function GetFolders( $resourceType, $currentFolder ) *************** *** 139,142 **** --- 137,141 ---- $sOriginalFileName = $sFileName ; $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; + $sExtension = strtolower( $sExtension ) ; global $Config ; Index: basexml.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** basexml.php 1 Sep 2005 18:15:43 -0000 1.4 --- basexml.php 29 Sep 2005 19:49:18 -0000 1.5 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 12,24 **** * This is the File Manager Connector for ASP. * - * Version: 2.0 RC3 - * Modified: 2004-12-10 17:49:19 - * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function CreateXmlHeader( $command, $resourceType, $currentFolder ) { // Create the XML document header. echo '<?xml version="1.0" encoding="utf-8" ?>' ; --- 13,41 ---- * This is the File Manager Connector for ASP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ ! ! function SetXmlHeaders() ! { ! // Prevent the browser from caching the result. ! // Date in the past ! header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ; ! // always modified ! header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ; ! // HTTP/1.1 ! header('Cache-Control: no-store, no-cache, must-revalidate') ; ! header('Cache-Control: post-check=0, pre-check=0', false) ; ! // HTTP/1.0 ! header('Pragma: no-cache') ; ! ! // Set the response format. ! header( 'Content-Type:text/xml; charset=utf-8' ) ; ! } function CreateXmlHeader( $command, $resourceType, $currentFolder ) { + SetXmlHeaders() ; + // Create the XML document header. echo '<?xml version="1.0" encoding="utf-8" ?>' ; *************** *** 35,37 **** --- 52,66 ---- echo '</Connector>' ; } + + function SendError( $number, $text ) + { + SetXmlHeaders() ; + + // Create the XML document header + echo '<?xml version="1.0" encoding="utf-8" ?>' ; + + echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ; + + exit ; + } ?> \ No newline at end of file Index: config.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.php 1 Sep 2005 18:15:43 -0000 1.1 --- config.php 29 Sep 2005 19:49:18 -0000 1.2 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 12,39 **** * Configuration file for the File Manager Connector for PHP. * - * Version: 2.0 RC3 - * Modified: 2005-02-08 12:01:53 - * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ global $Config ; ! // Path to user files relative to the document root. ! // SECURITY TIP: Uncomment the following line to set a fixed path. ! //$Config['UserFilesPath'] = '/UserFiles/' ; ! $Config['AllowedExtensions']['File'] = array() ; ! $Config['DeniedExtensions']['File'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg') ; ! ! $Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ; ! $Config['DeniedExtensions']['Image'] = array() ; ! ! $Config['AllowedExtensions']['Flash'] = array('swf','fla') ; ! $Config['DeniedExtensions']['Flash'] = array() ; ! ! $Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ; ! $Config['DeniedExtensions']['Media'] = array() ; ?> \ No newline at end of file --- 13,39 ---- * Configuration file for the File Manager Connector for PHP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ global $Config ; ! // SECURITY: You must explicitelly enable this "connector". (Set it to "true"). ! $Config['Enabled'] = false ; ! // Path to user files relative to the document root. ! $Config['UserFilesPath'] = '/UserFiles/' ; ! ! $Config['AllowedExtensions']['File'] = array() ; ! $Config['DeniedExtensions']['File'] = array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi') ; ! ! $Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ; ! $Config['DeniedExtensions']['Image'] = array() ; ! ! $Config['AllowedExtensions']['Flash'] = array('swf','fla') ; ! $Config['DeniedExtensions']['Flash'] = array() ; ! ! $Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ; ! $Config['DeniedExtensions']['Media'] = array() ; ?> \ No newline at end of file Index: util.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/util.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** util.php 1 Sep 2005 18:15:43 -0000 1.4 --- util.php 29 Sep 2005 19:49:18 -0000 1.5 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 12,21 **** * This is the File Manager Connector for ASP. * - * Version: 2.0 RC3 - * Modified: 2004-12-10 17:46:39 - * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function RemoveFromStart( $sourceString, $charToRemove ) --- 13,19 ---- * This is the File Manager Connector for ASP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function RemoveFromStart( $sourceString, $charToRemove ) Index: io.php =================================================================== RCS file: /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/default/connectors/php/io.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** io.php 1 Sep 2005 18:15:43 -0000 1.4 --- io.php 29 Sep 2005 19:49:18 -0000 1.5 *************** *** 1,5 **** ! <?php /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: --- 1,6 ---- ! <?php ! /* * FCKeditor - The text editor for internet ! * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: *************** *** 12,21 **** * This is the File Manager Connector for ASP. * - * Version: 2.0 RC3 - * Modified: 2005-02-19 16:03:39 - * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function GetUrlFromPath( $resourceType, $folderPath ) --- 13,19 ---- * This is the File Manager Connector for ASP. * * File Authors: ! * Frederico Caldeira Knabben (fr...@fc...) ! */ function GetUrlFromPath( $resourceType, $folderPath ) *************** *** 35,39 **** { // Get the resource type directory. - // $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '\\' ; $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '/' ; --- 33,36 ---- *************** *** 42,46 **** // Return the resource type directory combined with the required path. - // return $sResourceTypePath . str_replace( '/', '\\', RemoveFromStart( $folderPath, '/' ) ) ; return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ; } --- 39,42 ---- *************** *** 92,98 **** $sRealPath = realpath( './' ) ; - // $sSelfPath = str_replace( '/', '\\', $_SERVER['PHP_SELF'] ) ; $sSelfPath = $_SERVER['PHP_SELF'] ; - // $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '\\' ) ) ; $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ; --- 88,92 ---- |