Changeset 5706

Show
Ignore:
Timestamp:
04/10/08 14:20:22 (9 months ago)
Author:
inureyes
Message:

#922

  • [5705]를 1.6 트리에 반영
Location:
branches/1.6/components
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.6/components/Eolin.PHP.Core.php

    r5637 r5706  
    110110            } 
    111111        } 
     112        if (preg_match('/&#([0-9]{1,});/', $corrected)) 
     113            $corrected = mb_decode_numericentity($corrected, array(0x0, 0x10000, 0, 0xfffff), 'UTF-8'); 
    112114        return $corrected; 
    113115    } 
  • branches/1.6/components/Eolin.PHP.UnifiedEnvironment.php

    r5637 r5706  
    4444    $_SERVER['REMOTE_ADDR'] = $firstIP[0]; 
    4545} 
    46  
     46/* Workaround for iconv-absent environment. (contributed by Papacha) */ 
    4747if (!function_exists('iconv')) { 
    4848    if (function_exists('mb_convert_encoding')) { 
     
    5454    } 
    5555} 
     56/* Workaround for NCR treatment. (contributed by Laziel) */ 
     57if (!function_exists('mb_decode_numericentity')) {  
     58    function mb_decode_numericentity($str, $dumb = null, $dumber = null) { 
     59        if (!function_exists('_mb_decode_numericentity_callback') ) { 
     60            function _mb_decode_numericentity_callback($t) { 
     61                $decode = $t[1]; 
     62                    if ($decode < 128) { 
     63                        $str = chr($decode); 
     64                    } else if ($decode < 2048) { 
     65                        $str = chr(192 + (($decode - ($decode % 64)) / 64)); 
     66                        $str .= chr(128 + ($decode % 64)); 
     67                    } else { 
     68                        $str = chr(224 + (($decode - ($decode % 4096)) / 4096)); 
     69                        $str .= chr(128 + ((($decode % 4096) - ($decode % 64)) / 64)); 
     70                        $str .= chr(128 + ($decode % 64)); 
     71                    } 
     72                    return $str; 
     73            } 
     74        } 
     75        return preg_replace_callback('/&#([0-9]{1,});/', '_mb_decode_numericentity_callback', $str); 
     76    } 
     77} 
    5678?>