Skip to content

Commit

Permalink
Merge pull request #7351 from thierrymarianne/remove-deprecated-modifer
Browse files Browse the repository at this point in the history
Replace PCRE e modifier with callback
  • Loading branch information
Maxime Biloé committed Jan 18, 2017
2 parents f215ee5 + e605cc9 commit ea59592
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/webservice/WebserviceOutputJSON.php
Expand Up @@ -160,7 +160,13 @@ public function overrideContent($content)
{
$content = '';
$content .= json_encode($this->content);
$content = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", $content);
$content = preg_replace_callback(
"/\\\\u([a-f0-9]{4})/",
function ($matches) {
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec('U' . $matches[1])));
},
$content
);
return $content;
}

Expand Down

0 comments on commit ea59592

Please sign in to comment.