Open onkar-infoobjects opened 11 years ago
I have solved this issue by replacing line 79 & 80 by following code.
$str = preg_replace_callback('/&#([0-9]+)\;/m', function($m){ return code2utf($m[1],$lo); }, $str); $str = preg_replace_callback('/&#([0-9]+)\;/m', function($m){ return codeHex2utf($m[1],$lo);}, $str);
Had the same problem calling the library helper CodeIgniter and your solution worked properly. Thank you!
$lo it's null inside that function. "use" is required in order to make that variable available inside that function.
$str = preg_replace_callback('/\&\#([0-9]+)\;/m', function($m) use ($lo){return code2utf($m[1],$lo); }, $str);
$str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', function($m) use ($lo){return codeHex2utf($m[1],$lo);}, $str);
Thanks rzds
By use this my error is solved.
Thanks again!!
Hi guys,
Can you help me convert this to using preg_replace_callback
preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $input)
Similar warnings occur for other lines.
$ cat -n MPDF57/mpdf.php | sed -n '7663p; 12058p'
7663 $html = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$html );
12058 $html = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$html );
$
This forgotten thread just saved me, thank you all haha. It works just fine!
Hi guys,
Can you help me convert this to using preg_replace_callback
preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':"$2";'", $input)
I can't seem to figure out the preg_replace_callback for the code below
$html = preg_replace('/{DATE\s+(.*?)}/e',"date('\1')",$html );
preg_replace() has been used on line 79 & 80 but now in php5.5 it have been deprecated with preg_replace_callback(), what would be solution of this problem.
mpdf/includes/functions.php :: 79 & 80 line
75 if(!function_exists('strcode2utf')){ 76 function strcode2utf($str,$lo=true) { 77 //converts all the nnn; and hhh; in a string to Unicode 78 if ($lo) { $lo = 1; } else { $lo = 0; } 79 $str = preg_replace('/&#([0-9]+)\;/me', "code2utf('\1',{$lo})",$str); 80 $str = preg_replace('/&#x([0-9a-fA-F]+)\;/me', "codeHex2utf('\1',{$lo})",$str); 81 return $str; 82 } 83 }