Ticket #2701: freepbx-2.4.0-json-fix.patch

File freepbx-2.4.0-json-fix.patch, 2.7 kB (added by kRutOn, 9 months ago)

Changes Content-type for JSON responses to application/json

  • admin/common/json.inc.php

    old new  
    102102 * 
    103103 * // convert a complexe value to JSON notation, and send it to the browser 
    104104 * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); 
     105 * header("Content-type: application/json"); 
    105106 * $output = $json->encode($value); 
    106107 * 
    107108 * print($output); 
  • admin/config.php

    old new  
    4141                        include_once('common/json.inc.php'); 
    4242                        $response = do_reload(); 
    4343                        $json = new Services_JSON(); 
     44                        header("Content-type: application/json"); 
    4445                        echo $json->encode($response); 
    4546                break; 
    4647                case 'file': 
  • admin/modules/dashboard/page.index.php

    old new  
    678678                 
    679679                case 'info': 
    680680                        $json = new Services_JSON(); 
     681                        header("Content-type: application/json"); 
    681682                        echo $json->encode( 
    682683                                array( 
    683684                                        'procinfo'=>show_procinfo(), 
     
    689690                break; 
    690691                case 'stats': 
    691692                        $json = new Services_JSON(); 
     693                        header("Content-type: application/json"); 
    692694                        echo $json->encode( 
    693695                                array( 
    694696                                        'sysstats'=>show_sysstats(), 
     
    698700                break; 
    699701                case 'all': 
    700702                        $json = new Services_JSON(); 
     703                        header("Content-type: application/json"); 
    701704                        echo $json->encode( 
    702705                                array( 
    703706                                        'sysstats'=>show_sysstats(), 
  • admin/modules/framework/htdocs/admin/common/json.inc.php

    old new  
    102102 * 
    103103 * // convert a complexe value to JSON notation, and send it to the browser 
    104104 * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); 
     105 * header("Content-type: application/json"); 
    105106 * $output = $json->encode($value); 
    106107 * 
    107108 * print($output); 
  • admin/modules/framework/htdocs/admin/config.php

    old new  
    4141                        include_once('common/json.inc.php'); 
    4242                        $response = do_reload(); 
    4343                        $json = new Services_JSON(); 
     44                        header("Content-type: application/json"); 
    4445                        echo $json->encode($response); 
    4546                break; 
    4647                case 'file': 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads