Advanced search  

News:

cpg1.5.42 maintenance release - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix several minor issues. All fixes are not security critical, so if your gallery is running fine with cpg1.5.36, cpg1.5.38 or cpg1.5.40 you don't need to upgrade. If you are running an older version than cpg1.5.36, you must update to this latest version as soon as possible because of the security impact!
[more]

Pages: [1]   Go Down

Author Topic: Can't upload pics with "~"  (Read 2591 times)

0 Members and 1 Guest are viewing this topic.

FansCityEu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Can't upload pics with "~"
« on: September 28, 2014, 01:34:44 PM »

Hi,
I'm trying to upload a picture with batch with this name: 01~242.jpg and it gives me this error (I'm translating it from Spanish so it's similar): "Only files with the following extensions are accepted" and it includes .jpg, if I remove the ~ it works but if not it gave me that error. I have downloaded and uploaded (on ftp) to many pictures to change each one.. :/ What Can I do?
Logged

ron4mac

  • Dev Team member
  • Coppermine frequent poster
  • ****
  • Country: us
  • Offline Offline
  • Posts: 412
Re: Can't upload pics with "~"
« Reply #1 on: September 28, 2014, 02:18:28 PM »

Update you Coppermine installation to the latest version.
Logged

FansCityEu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Re: Can't upload pics with "~"
« Reply #2 on: September 28, 2014, 03:35:17 PM »

Hi,
I have the latest: 1.5.30
Update you Coppermine installation to the latest version.
Logged

ron4mac

  • Dev Team member
  • Coppermine frequent poster
  • ****
  • Country: us
  • Offline Offline
  • Posts: 412
Re: Can't upload pics with "~"
« Reply #3 on: September 28, 2014, 05:41:13 PM »

I've tried to replicate your problem but on my installation of 1.5.30 it functions without any error.
Logged

FansCityEu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Re: Can't upload pics with "~"
« Reply #4 on: September 28, 2014, 05:46:35 PM »

I think it's something related with the server or maybe because I'm using GD instead of Imagemagick :/ I don't know but I hate it.
I've tried to replicate your problem but on my installation of 1.5.30 it functions without any error.
Logged

ron4mac

  • Dev Team member
  • Coppermine frequent poster
  • ****
  • Country: us
  • Offline Offline
  • Posts: 412
Re: Can't upload pics with "~"
« Reply #5 on: September 28, 2014, 06:16:43 PM »

Hold on ... I've been able to replicate your issue.  Give me a few hours to come up with a solution for you.
Logged

FansCityEu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Re: Can't upload pics with "~"
« Reply #6 on: September 28, 2014, 06:30:46 PM »

Thank you so much!
Hold on ... I've been able to replicate your issue.  Give me a few hours to come up with a solution for you.
Logged

ron4mac

  • Dev Team member
  • Coppermine frequent poster
  • ****
  • Country: us
  • Offline Offline
  • Posts: 412
Re: Can't upload pics with "~"
« Reply #7 on: September 29, 2014, 12:33:05 AM »

Sorry I couldn't get to this sooner ...

This interim patch for the issue you are experiencing is not official.

In the file searchnew.php at about line #106 change:
Code: [Select]
    $encoded_picfile = base64_encode($picfile);to:
Code: [Select]
    $encoded_picfile = urlencode(base64_encode($picfile));
And in the file showthumb.php at about line #141 change:
Code: [Select]
$matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z\/\\\\_.-\s]+$/');to: (add a tilde [~] after the lowercase z)
Code: [Select]
$matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z~\/\\\\_.-\s]+$/');

Anything official involving this would be pending whether ~'s are to be acceptably allowed in file names.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15039
Re: Can't upload pics with "~"
« Reply #8 on: September 29, 2014, 09:17:58 AM »

I don't see a reason to disallow the tilde, as it's also used for the HTTP upload forms:
Code: (db_input.php) [Select]
    while (file_exists($dest_dir . $picture_name)) {
        $picture_name = $matches[1] . '~' . $nr++ . '.' . $matches[2];
    }

I'll have a closer look at your patch and add it to our SVN repository, if applicable.
Logged

FansCityEu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Re: Can't upload pics with "~"
« Reply #9 on: September 29, 2014, 03:14:36 PM »

It worked! Thank you so much :D
Sorry I couldn't get to this sooner ...

This interim patch for the issue you are experiencing is not official.

In the file searchnew.php at about line #106 change:
Code: [Select]
    $encoded_picfile = base64_encode($picfile);to:
Code: [Select]
    $encoded_picfile = urlencode(base64_encode($picfile));
And in the file showthumb.php at about line #141 change:
Code: [Select]
$matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z\/\\\\_.-\s]+$/');to: (add a tilde [~] after the lowercase z)
Code: [Select]
$matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z~\/\\\\_.-\s]+$/');

Anything official involving this would be pending whether ~'s are to be acceptably allowed in file names.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15039
Re: Can't upload pics with "~"
« Reply #10 on: October 06, 2014, 02:23:00 PM »

Those changes have been committed in SVN revision 8741 and will be part of cpg1.5.32 and later.
Logged
Pages: [1]   Go Up
 

Page created in 0.07 seconds with 20 queries.