Pages: 1
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/
Hi Stefan,
Can you edit file include/random_compat/random.php, line 130, replace:
PHP_VERSION_ID >= 50307
by
PHP_VERSION_ID >= 50303
and tell us if it works any better?
Offline
Same problemm, trying solution to change the code id to 50303 did not help
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 :
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
Hi plg,
I have follow the fix and it works fine.
It solved my problem, Thanks
Hein / Netherlands
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
This fix will be available in Piwigo 2.8.2, see [Github] Piwigo issue #479
Offline
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
We should release Piwigo 2.8.2 within a few days.
Offline
Pages: 1