Announcement

#1 2016-05-07 18:23:55

Stefan V.B.
Guest

Fatal error in 2.8.1 when I want to send a notification to a group

Hello,

I just updated from Piwigo version 2.8.0 to 2.8.1. I tried to send a notification to a group about a new album. I get the following fatal error:

Fatal error: Uncaught exception 'Exception' with message 'There is no suitable CSPRNG installed on your system' in /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/include/random_compat/random.php:185 Stack trace: #0 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/include/functions_session.inc.php(71): random_bytes(40) #1 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/include/functions_user.inc.php(1567): generate_key(30) #2 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/include/functions_mail.inc.php(541): create_user_auth_key('3', 'normal') #3 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/admin/album_notification.php(174): pwg_mail_group('2', Array, Array) #4 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/admin/album.php(88): include('/home/zirbitzko...') #5 /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/admin.php(301): include('/home/zirbitzko...') #6 {main} thrown in /home/zirbitzkogel.at/www.zirbitzkogel.at/photos/include/random_compat/random.php on line 185

Anyhow, despite of the fatal error, the members of the group got the notification email about the new album.



Best regards,

    Stefan


Piwigo version: 2.8.1
PHP version: 5.3.3-7+squeeze19
MySQL version: 5.1.73-1
Piwigo URL: http://zirbitzkogel.at/photos/

 

#2 2016-05-09 18:08:19

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

Re: Fatal error in 2.8.1 when I want to send a notification to a group

Hi Stefan,

Can you edit file include/random_compat/random.php, line 130, replace:

Code:

            PHP_VERSION_ID >= 50307

by

Code:

            PHP_VERSION_ID >= 50303

and tell us if it works any better?

Offline

 

#3 2016-05-10 14:05:15

Hein
Guest

Re: Fatal error in 2.8.1 when I want to send a notification to a group

Same problemm, trying solution to change the code id  to 50303 did not help

 

Notice: Undefined offset: 5 in /var/www/piwigo.org/forum/include/parser.php on line 551

#4 2016-05-10 14:12:40

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

Re: Fatal error in 2.8.1 when I want to send a notification to a group

OK, I've been working on this problem yesterday. If you want to test the fix, follow the steps:

1) download srand.php on [Github] Secure-random-bytes-in-PHP file srand.php (right click "save as" on top right button "raw"). Copy file srand.php  in the "include" directory of Piwigo.

2) in file include/functions_session.inc.php, replace function generate_key (line 63), by :

Code:

function generate_key($size)
{
  include_once(PHPWG_ROOT_PATH.'include/random_compat/random.php');

  try
  {
    $bytes = random_bytes($size+10);
  }
  catch (Exception $ex)
  {
    include_once(PHPWG_ROOT_PATH.'include/srand.php');
    $bytes = secure_random_bytes($size+10);
  }

  return substr(
    str_replace(
      array('+', '/'),
      '',
      base64_encode($bytes)
      ),
    0,
    $size
    );
}

Offline

 

#5 2016-05-10 14:28:57

Hein
Guest

Re: Fatal error in 2.8.1 when I want to send a notification to a group

Hi plg,

I have follow the fix and it works fine.

It solved my problem, Thanks

Hein / Netherlands

 

#6 2016-05-13 12:53:53

abravorus
Member
2015-03-03
36

Re: Fatal error in 2.8.1 when I want to send a notification to a group

Hi,

It fixed this problem for me too, thanks.

Piwigo 2.8.1
PHP: 5.4.45-1~dotdeb+7.1
MySQL: 5.5.47-37.7
Piwigo URL: http://terijoki.spb.ru/photos/

Offline

 

#7 2016-05-13 13:47:21

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

Re: Fatal error in 2.8.1 when I want to send a notification to a group

This fix will be available in Piwigo 2.8.2, see [Github] Piwigo issue #479

Offline

 

#8 2016-06-04 13:48:54

manumusik
Member
2016-06-04
1

Re: Fatal error in 2.8.1 when I want to send a notification to a group

Thank you very much - it fixed my problem, too.
Before I used your fix, I couldn't change user access rights for galleries anymore, but now it works.

Best regards
Manumusik

Offline

 

#9 2016-06-04 22:38:54

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

Re: Fatal error in 2.8.1 when I want to send a notification to a group

We should release Piwigo 2.8.2 within a few days.

Offline

 

Board footer

Powered by FluxBB

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