From dominique.faure at gmail.com Mon Jan 8 08:11:04 2018 From: dominique.faure at gmail.com (Dominique Faure) Date: Mon, 8 Jan 2018 15:11:04 +0100 Subject: [pmwiki-devel] PHP 7.2 Warning while editing wiki pages Message-ID: Hi, As I was updating my development pmwiki's web environment, I noticed the following warning while editing a wiki page: *Warning*: count(): Parameter must be an array or an object that implements Countable in */home/debian/websites/wiki.dfaure.fr/scripts/forms.php * on line *109* The running context: * php7.2 version 7.2.1-1+0~20180105151615.16+stretch~1.gbpd3910a as provided by the debian php maintainer on https://packages.sury.org/php * PmWiki latest release version In the offending line: while (count($posnames) > 0 && count(@$args['']) > 0) { The $args array is being left empty by a previous ParseArgs() call when processing the page edit form specific (:input ...:) directives which don't provide extra arguments (I didn't made further tests on other forms). As a simple fix, the previous line could be rewritten as: while (count($posnames) > 0 && @count($args['']) > 0) { Regards -- Dominique -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominique.faure at gmail.com Mon Jan 8 14:39:00 2018 From: dominique.faure at gmail.com (Dominique Faure) Date: Mon, 8 Jan 2018 21:39:00 +0100 Subject: [pmwiki-devel] PHP 7.2 Warnings while using pagelist Message-ID: Hi, Although notified in the changelog for the 2.2.106 version, the PagelistSort() function is still using create_function() and triggers warnings under php 7.2 such as: *Deprecated*: Function create_function() is deprecated in */home/debian/websites/wiki.dfaure.fr/scripts/pagelist.php * on line *510* Regards -- Dominique -------------- next part -------------- An HTML attachment was scrubbed... URL: From 5ko at 5ko.fr Mon Jan 8 16:22:01 2018 From: 5ko at 5ko.fr (Petko Yotov) Date: Mon, 08 Jan 2018 23:22:01 +0100 Subject: [pmwiki-devel] PHP 7.2 Warnings while using pagelist In-Reply-To: References: Message-ID: <22431db216d6ea2f74af482113cad978@5ko.fr> Sorry, I'll finish this for the next version. Petko On 08/01/2018 21:39, Dominique Faure wrote: > Hi, > > Although notified in the changelog for the 2.2.106 version, the > PagelistSort() function is still using create_function() and triggers > warnings under php 7.2 such as: > > *Deprecated*: Function create_function() is deprecated in > */home/debian/websites/wiki.dfaure.fr/scripts/pagelist.php > * on line *510* > > Regards