[pmwiki-users] Function not compatible anymore with php72

ABClf languefrancaise at gmail.com
Sat Feb 8 17:40:14 PST 2020

Hello hello,

My config used to have this code (added for sorting search result in
alphabetical order, including french diacritic : a b c d eéè f ...) :

# Sorting pages using locale (sort 'é', 'è', 'ê', etc. with 'e' for example)
$PageListSortCmp['namelocalesort'] = 'LocaleSort($x, $y)'; */
$PageListSortCmp['title'] = 'LocaleSort($PCache[$x][\'=title\'],
function LocaleSort($a, $b) {
  $x = array($a, $b);
  setlocale(LC_ALL, 'fr_FR.utf8'); ## or 'fr_FR.utf8'
  return ($x[0]==$a)? -1:1;

I believe this doesn't work anymore (with recent php) : when used in
config, I encounter this error :

Deprecated: Function create_function() is deprecated in
/home/www/dev6/scripts/pagelist.phpon line 520

Warning: Cannot modify header information - headers already sent by
(output started at /home/www/dev6/scripts/pagelist.php:520) in
/home/www/dev6/pmwiki.php on line 1337

I need help for updating that piece of code ; if possible I would like
to have the requested behaviour (alphabetical order including
diacritic) by default (no need to add param to search box).

Thank you.

More information about the pmwiki-users mailing list