Piwigo / Piwigo-Android

Piwigo Native Android App
GNU General Public License v3.0
140 stars 43 forks source link

WIP #175 - Missing extension in `file` column #194

Closed Valou447 closed 4 years ago

Valou447 commented 4 years ago
ramack commented 4 years ago

@voriondev what is the meaning if you put "WIP" in the heading of a PR? I somehow implicitly would understand it as "still working on it, not yet ready for merge, but comments welcome and also letting others know the I work on it" - is that correct? Because I've seen that you also merged some which still had WIP in the title, so my understanding doesn't perfectly fit to how you seem to use it...

ramack commented 4 years ago

@voriondev is this still WIP, or should we merge it?

Valou447 commented 4 years ago

It is still WIP, since this was not very high prio I did focus on something else

ramack commented 4 years ago

Ah, this one is what I meant int he inline comment of #214, so forget the comment about it there :-)

plegall commented 4 years ago

Several users have reported (to Piwigo.com support) this problem. I'm going to fix on Piwigo side for now, but a new release of Piwigo-Android would be very valuable.

plegall commented 4 years ago

So for now, I have added this on Piwigo side:

  // temporary fix for Piwigo-Android 1.0.2 which do not add the file extension (breaking Batch Downloader for example)
  if (
    isset($_SERVER["HTTP_USER_AGENT"]) and preg_match('/Piwigo-Android/', $_SERVER['HTTP_USER_AGENT'])
    and isset($_REQUEST['method']) and 'pwg.images.upload' == $_REQUEST['method']
    and isset($_POST['name'])
  )
  {
    $ext = pathinfo($_POST['name'], PATHINFO_EXTENSION);
    if (empty($ext))
    {
      $_POST['name'].= '.jpg';
    }
  }