Show
Ignore:
Timestamp:
10/03/08 01:07:01 (14 months ago)
Author:
bchoate
Message:

Merging fireball branch changes to-date to trunk: svn merge -r2974:3081 http://code.sixapart.com/svn/movabletype/branches/fireball .

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/php/lib/function.mtvar.php

    r2873 r3082  
    111111                } 
    112112            } 
     113            else { 
     114                if (array_key_exists('to_json', $args) && $args['to_json']) { 
     115                    if (function_exists('json_encode')) { 
     116                        $return_val = json_encode($value); 
     117                    } else { 
     118                        $return_val = ''; 
     119                    } 
     120                } 
     121            } 
    113122        } 
    114123        elseif (is_array($value)) { 
     
    140149            } 
    141150            else { 
    142                 if (!array_key_exists('to_json', $args) && $args['to_json']) { 
    143                     $glue = $args['glue']; 
    144                     if (!isset($glue)) 
    145                         $glue = ''; 
    146                     $return_val = implode($glue, $value); 
     151                if (array_key_exists('to_json', $args) && $args['to_json']) { 
     152                    if (function_exists('json_encode')) { 
     153                        $return_val = json_encode($value); 
     154                    } else { 
     155                        $return_val = ''; 
     156                    } 
    147157                } 
    148158            }