Hello/Hi/Greetings,
I updated to ubuntu 16.04 with php 7. Movies no longer play, instead I get the error:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; getID3 has a deprecated constructor in /mnt/s2/piwigo/plugins/charlies/getid3/getid3/getid3.php on line 18
Fatal error: Uncaught Error: Call to undefined function eregi() in /mnt/s2/piwigo/plugins/charlies/getid3/getid3/getid3.php:63 Stack trace: #0 /mnt/s2/piwigo/plugins/charlies/charlies.inc.php(44): getID3->getID3() #1 /mnt/s2/piwigo/plugins/charlies/main.inc.php(140): Charlies_content(Array) #2 /mnt/s2/piwigo/include/functions_plugins.inc.php(229): render_Charlie_element_content('', Array) #3 /mnt/s2/piwigo/picture.php(988): trigger_change('render_element_...', '', Array) #4 {main} thrown in /mnt/s2/piwigo/plugins/charlies/getid3/getid3/getid3.php on line 63
I get only the second part of the error using jplayer, both parts using videoJS.
Should I try and put php 5.4 back in or is this something I can fix simply by replacing eregi() with preg_match() in the charlies content plugin .php files?
Thanks!
Piwigo version: 2.8.1
PHP version: 7.0
MySQL version: 14.14
Piwigo URL: http://
Offline
Replacing the three instances of eregi() in getid3.php in Charlies plugin folder fixed it:
The file is here:
from main piwigo folder: plugins/charlies/getid3/getid3/getid3.php
Search for eregi, and replace with preg_match.
Then put /i at the end of the part of the command inside the quotes: ' '
For example:
if (eregi('([0-9]+)M', $memory_limit, $matches)) {
becomes:
if (preg_match('([0-9]+)M /i', $memory_limit, $matches)) {
Do both those steps for the three places where eregi appears and the movies will play again.
Last edited by drbubbles (2016-05-22 01:45:25)
Offline
For the VideoJS plugin configuration, I found I could avoid further errors by selecting "No" for "Metadata, Show File"
Last edited by drbubbles (2016-08-29 03:11:41)
Offline
Hello,
I'm running in the same issue as you after upgradding to PHP7. I followed your advice to replace eregi with preg_match and I also added the /i modifier, but I still get an error:
Warning: preg_match(): Unknown modifier 'M' in /www/vhosts/.........../htdocs/plugins/charlies/getid3/getid3/getid3.php on line 64
The code here looks like this. It is line 64 because I doubled the original line 63 and commented it. Please see below:
// if (eregi('([0-9]+)M', $memory_limit, $matches)) {
if (preg_match('([0-9]+)M /i', $memory_limit, $matches)) {
What is wrong? What else do I need to change?
Kind regards
Jens
Offline
Hello,
I fixed this issue on my own. Before changing eregi to preg_match with the /i modifier, I needed to change the deprecated constructor to public function __constructor. Afterwards the preg_match did no longer complain about the unknown modifier 'M'.
Kind regards
Jens
Offline
Hello
thank you but could you report all the changes you made so we could update much mroe easily? Thank you
Offline
Hello,
yes, you're right. I should have added this information earlier. Here are the details I made:
File: plugins/charlies/getid3/getid3/getid3.php
50c50 < function getID3() --- > public function __constructor() 63c63 < if (eregi('([0-9]+)M', $memory_limit, $matches)) { --- > if (preg_match('([0-9]+)M /i', $memory_limit, $matches)) { 219c219 < if (eregi('1 File\(s\)[ ]+([0-9]+) bytes', $dir_output, $matches)) { --- > if (preg_match('1 File\(s\)[ ]+([0-9]+) bytes /i', $dir_output, $matches)) { 225c225 < if (eregi('([0-9]+) ([0-9]{4}-[0-9]{2}\-[0-9]{2} [0-9]{2}:[0-9]{2}) '.preg_quote($filename).'$', $dir_output, $matches)) { --- > if (preg_match('([0-9]+) ([0-9]{4}-[0-9]{2}\-[0-9]{2} [0-9]{2}:[0-9]{2}) '.preg_quote($filename).'$ /i', $dir_output, $matches)) {
File: plugins/charlies/charlies.inc.php
42a43,44 > // Added by jheinitz - 24-Jan-2017 > require_once(CHARLIES_PATH.'getid3/getid3/getid3.lib.php');
The second change also solved my problem that I reported here: Plugin Charlie's Content: Class getid3_lib not found
Thanks and kind regards
Jens
Offline