Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'm20_MDL-25895_repository_ajax' of git://github.com/dong…

…sheng/moodle
  • Loading branch information...
commit a84299fee5ad34f14fa54240c66f44dc2c016cb8 2 parents 6378603 + a7db0a2
@skodak skodak authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 repository/repository_ajax.php
View
13 repository/repository_ajax.php
@@ -52,7 +52,12 @@
$search_text = optional_param('s', '', PARAM_CLEANHTML);
$linkexternal = optional_param('linkexternal', '', PARAM_ALPHA);
-@header('Content-type: text/plain; charset=utf-8');
+list($context, $course, $cm) = get_context_info_array($contextid);
+require_login($course, false, $cm);
+$PAGE->set_context($context);
+
+echo $OUTPUT->header(); // send headers
+@header('Content-type: text/html; charset=utf-8');
// if uploaded file is larger than post_max_size (php.ini) setting, $_POST content will lost
if (empty($_POST) && !empty($action)) {
@@ -60,12 +65,6 @@
die(json_encode($err));
}
-list($context, $course, $cm) = get_context_info_array($contextid);
-require_login($course, false, $cm);
-$PAGE->set_context($context);
-
-echo $OUTPUT->header(); // send headers
-
if (!confirm_sesskey()) {
$err->error = get_string('invalidsesskey');
die(json_encode($err));
Please sign in to comment.
Something went wrong with that request. Please try again.