Ignore:
Timestamp:
2007/12/23 08:23:32 (16 years ago)
Author:
adachi
Message:

JSONデータが正常にデコードできない不具合を修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php

    r16852 r16944  
    7474        echo $this->encode($this->arrData); 
    7575    } 
     76 
     77    /** 
     78     * JSONデータをデコードする. 
     79     * 
     80     * php5.2.0からpreg_match関数に渡せるデータ長に制限がある(?)ため, 
     81     * Services_JSONが正常に動作しなくなる. 
     82     * そのため5.2.0以上の場合は組み込み関数のjson_decode()を使用する. 
     83     * 
     84     * @param string $str 
     85     * @return StdClass 
     86     */ 
     87    function decode($str) { 
     88        if (version_compare(phpversion(), '5.2.0', '>=')) { 
     89            return json_decode($str); 
     90        } 
     91 
     92        return parent::decode($str); 
     93    } 
    7694} 
Note: See TracChangeset for help on using the changeset viewer.