X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fencode%2Fcp1251.php;fp=functions%2Fencode%2Fcp1251.php;h=58a0282b64e24fd151caf04b6b828a56a8fa31b2;hp=2afead9c162bb660b102654d43308623df0992db;hb=6c4e2e9b8fdeac2405d55a7cc00f580f0b6c87c3;hpb=68e2651025f91ccd3671c150a3ed15fc146959d3 diff --git a/functions/encode/cp1251.php b/functions/encode/cp1251.php index 2afead9c..58a0282b 100644 --- a/functions/encode/cp1251.php +++ b/functions/encode/cp1251.php @@ -22,7 +22,7 @@ function charset_encode_cp1251 ($string) { // don't run encoding function, if there is no encoded characters if (! preg_match("'&#[0-9]+;'",$string) ) return $string; - $string=preg_replace("/&#([0-9]+);/e","unicodetocp1251('\\1')",$string); + $string=preg_replace_callback("/&#([0-9]+);/", 'unicodetocp1251', $string); return $string; } @@ -35,10 +35,11 @@ function charset_encode_cp1251 ($string) { * Don't use it or make sure, that functions/encode/cp1251.php is * included. * - * @param int $var decimal unicode value + * @param array $matches array with first element a decimal unicode value * @return string cp1251 character */ -function unicodetocp1251($var) { +function unicodetocp1251($matches) { + $var = $matches[1]; $cp1251chars=array('160' => "\xA0", '164' => "\xA4",