Announcement

#1 2022-10-12 10:52:54

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

[13] download issues

From [Forum, post 184470 by SA in topic 32250] Piwigo 13 and [Forum, post 184474 by Aby in topic 32250] Piwigo 13

I am Unable to download existing individual photos after the major upgrade.

Warning: Cannot modify header information - headers already sent in /var/www/html/piwigo/action.php on line 228

Warning: Cannot modify header information - headers already sent in /var/www/html/piwigo/action.php on line 228

Warning: Cannot modify header information - headers already sent in /var/www/html/piwigo/action.php on line 228

Warning: Cannot modify header information - headers already sent in /var/www/html/piwigo/action.php on line 228

Warning: Cannot modify header information - headers already sent in /piwigo/action.php on line 228
����JFIF``��C    $.' ",#(7),01444'9=82<.342��C  2!

Offline

 

#2 2022-10-12 10:57:44

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [13] download issues

We have implemented a single change in action.php between Piwigo 12 and Piwigo 13 : [Github] Piwigo commit dd44d0e4

I would like you test the action.php file from Piwigo 12 and tell us if it works any better. You can download it on https://raw.githubusercontent.com/Piwig … action.php

Offline

 

#3 2022-10-12 15:38:58

windracer
Member
St. Pete, FL
2014-12-28
445

Re: [13] download issues

Wow, I guess I don't download photos very often (from my own gallery, heh). I didn't notice this in any of the beta versions, but sure enough when I try to download a photo from both of my galleries (upgraded to 13.0), I get the raw file data in the browser window (garbage) instead of the file downloading.

I can confirm, however, that using the old action.php file seems to fix the issue.

Offline

 

#4 2022-10-12 15:57:54

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [13] download issues

I had no problem with the action.php file in Piwigo 12. I accepted a pull-request because some users had problems. I have no problem with the new action.php but if it's broken for many users, I'll make a rollback on this commit.

Offline

 

#5 2022-10-12 16:43:35

erAck
Only trying to help
2015-09-06
2018

Re: [13] download issues

I could reproduce the headers sent problem. But instead of rolling back I suggest to move only the
foreach ($http_headers as $header)
loop before the
if (ob_get_length() !== FALSE)
but keep the ob_flush()/flush() change. With that, the problem is gone for me.

Though I have no idea how headers could had been sent before the foreach sending headers was executed..

Edit: I created PR https://github.com/Piwigo/Piwigo/pull/1749

Edit2: that https://www.php.net/manual/en/function.header.php sheds some light:

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called.

PHP is such a crap..


Running Piwigo at https://erack.net/gallery/

Offline

 

#6 2022-10-17 12:54:57

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [13] download issues

Hi erAck,

Did you test your solution with PHP 7.x and 8.x ?

Offline

 

#7 2022-10-17 23:05:39

erAck
Only trying to help
2015-09-06
2018

Re: [13] download issues

Only with PHP 7.4


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2022-10-20 02:12:49

Nigel-Aves
Member
2015-09-22
63

Re: [13] download issues

I just tried on PIWIGO 13 and PHP 8.0 >> and it worked with no issues.

Nigel.

Last edited by Nigel-Aves (2022-10-20 03:51:55)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact