Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[Résolu]Warning: preg_replace_callback(): Requires argument 2
#2
tu es en PHp 5.5.8 et :
preg_replace(): The /e modifier is deprecated, (depuis 5.5.0 : Le modificateur /e est obsolète)

il faut remplacer les lignes d'origine /lib/html_entity_decode_utf8.php
$string = preg_replace('~&#x0*([0-9a-f]+);~ei', '_code2utf8(hexdec("\\1"))', $string);
$string = preg_replace('~&#0*([0-9]+);~e', '_code2utf8(\\1)', $string);
Par les ligne suivantes
$string = preg_replace('~&#x0*([0-9a-f]+);~i', '_code2utf8(hexdec("\\1"))', $string);
$string = preg_replace('~&#0*([0-9]+);~', '_code2utf8(\\1)', $string);
pour le moment en simplifiant Wink

il faut aussi modifier
/lib/html_entity_decode_php4.php en ligne 306 et 307

je vais signaler le problème

Sinon
modif à faire (A tester...)
/lib/html_entity_decode_utf8.php
Code :
    //replace numeric entities
    /*
    $string = preg_replace('~&#x0*([0-9a-f]+);~ei', '_code2utf8(hexdec("\\1"))', $string);
    $string = preg_replace('~&#0*([0-9]+);~e', '_code2utf8(\\1)', $string);
    */
    $string = preg_replace_callback('~&#x([0-9a-f]+);~i',
                         function($matches) {
                           __code_to_utf8($matches[1]);
                         }, $string);
    $string = preg_replace_callback('~&#([0-9]+);~',
                         function($matches) {
                           __code_to_utf8($matches[1]);
                         }, $string);
/lib/html_entity_decode_php4.php
Code :
    /*
    $return_text = strtr($text_to_convert, $htmlentities_table);
    $return_text = preg_replace('~&#x([0-9a-f]+);~ei', 'code_to_utf8(hexdec("\\1"))', $return_text);
    $return_text = preg_replace('~&#([0-9]+);~e', 'code_to_utf8("\\1")', $return_text);
    return $return_text;
    */
    $return_text = strtr($text_to_convert, $htmlentities_table);
    $return_text = preg_replace_callback('~&#x([0-9a-f]+);~i',
                         function($matches) {
                           __code_to_utf8($matches[1]);
                         }, $return_text);
    $return_text = preg_replace_callback('~&#([0-9]+);~',
                         function($matches) {
                           __code_to_utf8($matches[1]);
                         }, $return_text);
    return $return_text;
J-C Etiemble v 2.2.xx


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)