Opened 15 years ago

Closed 15 years ago

#2936 closed Bug (fixed)

Error creating folder 'dirname' {Can't create 'dirname' directory}

Reported by: SLX Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone: FCKeditor 2.6.5
Component: Server : PHP Version: FCKeditor 2.6.4
Keywords: Review+ Cc:

Description

If in "fckeditor\editor\filemanager\connectors\php\config.php" I set only one directory name above the root, ex.

$Config['UserFilesPath'] = '/userfiles/' ;

I can't do a quick upload a file. Message box say that: "Error creating folder 'userfiles' {Can't create '/userfiles/' directory}"

By using more directories in the path, like:

$Config['UserFilesPath'] = '/userfiles/abc/' ;

the error doesn't show.

I think this is a bug in the file "fckeditor\editor\filemanager\connectors\php\io.php":

101:	// Check if the parent exists, or create it.
102:	if ( !file_exists( $sParent ) )
103:	{
104:		//prevents agains infinite loop when we can't create root folder

This will try to create a directory "" (empty string) if the config has one directory in the path, because the parent is root (/) and cannot be created. So I think it should be modified:

101:	// Check if the parent exists, or create it.
102:	if ( '''!empty($sParent) &&''' !file_exists( $sParent ) )
103:	{
104:		//prevents agains infinite loop when we can't create root folder

After modification the files are uploaded correctly.

Attachments (1)

2936.patch (1.2 KB) - added by Alfonso Martínez de Lizarrondo 15 years ago.
Proposed patch

Download all attachments as: .zip

Change History (6)

comment:1 Changed 15 years ago by SLX

Sorry, the new code should look like this:

101:	// Check if the parent exists, or create it.
102:	if ( !empty($sParent) && !file_exists( $sParent ) )
103:	{
104:		//prevents agains infinite loop when we can't create root folder

comment:2 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Keywords: HasPatch added

#3348 has been marked as dup

Changed 15 years ago by Alfonso Martínez de Lizarrondo

Attachment: 2936.patch added

Proposed patch

comment:3 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review? added; HasPatch removed
Milestone: FCKeditor 2.6.5
Owner: set to Alfonso Martínez de Lizarrondo
Status: newassigned

The patch just adds the suggested check.

comment:4 Changed 15 years ago by Wiktor Walc

Keywords: Review+ added; Review? removed

comment:5 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: assignedclosed

Fixed with [4198]

Thank you for the report and patch.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy