Changeset 108877 in spip-zone


Ignore:
Timestamp:
Feb 9, 2018, 4:04:06 PM (22 months ago)
Author:
marcimat@…
Message:

Compat PHP 7.2 : create_function => function (les plus simples, mais il en reste !…)

Location:
_core_/plugins/textwheel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/textwheel/inc/texte.php

    r106674 r108877  
    375375        $debut_table = $summary = '';
    376376        $l = 0;
    377         $numeric = true;
    378377
    379378        // Traiter chaque ligne
     
    459458        // Reperer egalement les colonnes numeriques pour les cadrer a droite
    460459        $rowspans = $numeric = array();
    461         $n = count($lignes[0]);
     460        $n = $lignes ? count($lignes[0]) : 0;
    462461        $k = count($lignes);
    463462        // distinguer les colonnes numeriques a point ou a virgule,
  • _core_/plugins/textwheel/lib/yaml/sfYamlInline.php

    r82427 r108877  
    111111      (1 == count($keys) && '0' == $keys[0])
    112112      ||
    113       (count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
     113      (count($keys) > 1 && array_reduce($keys, function($v,$w) { return (integer) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2))
    114114    {
    115115      $output = array();
     
    223223      $buffer = str_replace(array('\\n', '\\r'), array("\n", "\r"), $buffer);
    224224                        if (strpos($buffer,'\\x')!==false){
    225                                 $buffer = preg_replace_callback(',\\\\x([0-9a-f]+),', create_function('$m', 'return chr(hexdec($m[1]));'), $buffer);
     225                                $buffer = preg_replace_callback(',\\\\x([0-9a-f]+),', function($m) { return chr(hexdec($m[1])); }, $buffer);
    226226                        }
    227227    }
Note: See TracChangeset for help on using the changeset viewer.