coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: stevekwok on August 09, 2005, 07:24:21 PM

Title: Why cpg remove "." in directory names?
Post by: stevekwok on August 09, 2005, 07:24:21 PM
in searchnew.php cpg remove all "." in directory names. Is it intentionally?

My utf-8 gentoo linux does allow I put "." in filenames and directory names.

regards,
Steve Kwok

Quotefunction CPGscandir($dir, &$expic_array)
{
    $dir = str_replace(".","" ,$dir);
    static $dir_id = 0;
    static $count = 0;
    static $pic_id = 0;


Title: Re: Why cpg remove "." in directory names?
Post by: Joachim Müller on August 10, 2005, 06:37:07 AM
you shouldn't have dots in file or folder names (except the one dot that separates the file name from the extension). Coppermine does this to avoid issues.
Title: Re: Why cpg remove "." in directory names?
Post by: stevekwok on August 10, 2005, 04:00:23 PM
Just curious!! Why?

Even coppermine release is named "cpg1.3.3.zip" <- a lot of dots.

Regards,
Steve
Title: Re: Why cpg remove "." in directory names?
Post by: donnoman on August 11, 2005, 04:41:28 AM
part of it is just to normalize the name and prevent problems. The other part is security, its a way to avoid people screwing around with things like ./../../../../filename.jpg which might be out of the document root or to cause coppermine to retrieve files such as ../../../../etc/passwd from a poorly configured linux host.