MDL-25973 add missing charset
[moodle.git] / lib / ajax / getnavbranch.php
index 623f790..d00bef9 100644 (file)
@@ -48,7 +48,7 @@ try {
     $navigation = new global_navigation_for_ajax($PAGE, $branchtype, $branchid);
 
     $linkcategories = false;
-    
+
     if ($instanceid!==null) {
         // Get the db record for the block instance
         $blockrecord = $DB->get_record('block_instances', array('id'=>$instanceid,'blockname'=>'navigation'));
@@ -86,17 +86,17 @@ try {
         $block->trim($navigation, $trimmode, $trimlength, ceil($trimlength/2));
     }
     $converter = new navigation_json();
-    
+
     // Find the actuall branch we are looking for
     $branch = $navigation->find($branchid, $branchtype);
-    
+
     // Remove links to categories if required.
     if (!$linkcategories) {
         foreach ($branch->find_all_of_type(navigation_node::TYPE_CATEGORY) as $category) {
             $category->action = null;
         }
     }
-    
+
     // Stop buffering errors at this point
     $html = ob_get_contents();
     ob_end_clean();
@@ -116,6 +116,6 @@ if (empty($branch) || $branch->nodetype !== navigation_node::NODETYPE_BRANCH) {
 // Prepare an XML converter for the branch
 $converter->set_expandable($navigation->get_expandable());
 // Set XML headers
-header('Content-type: text/plain');
+header('Content-type: text/plain; charset=utf-8');
 // Convert and output the branch as XML
 echo $converter->convert($branch);