"MDL-23917, move action parameter above"
authorDongsheng Cai <unoter@gmail.com>
Wed, 25 Aug 2010 05:56:48 +0000 (05:56 +0000)
committerDongsheng Cai <unoter@gmail.com>
Wed, 25 Aug 2010 05:56:48 +0000 (05:56 +0000)
comment/comment_ajax.php

index 8aeb4bc..022676f 100644 (file)
@@ -29,6 +29,8 @@ list($context, $course, $cm) = get_context_info_array($contextid);
 $PAGE->set_context($context);
 $PAGE->set_url('/comment/comment_ajax.php');
 
+$action    = optional_param('action',    '', PARAM_ALPHA);
+
 // XXX: display comments in frontpage without login
 if ($context->id != get_context_instance(CONTEXT_COURSE, SITEID)->id
     or $action == 'add'
@@ -37,7 +39,6 @@ if ($context->id != get_context_instance(CONTEXT_COURSE, SITEID)->id
 }
 require_sesskey();
 
-$action    = optional_param('action',    '', PARAM_ALPHA);
 $area      = optional_param('area',      '', PARAM_ALPHAEXT);
 $client_id = optional_param('client_id', '', PARAM_RAW);
 $commentid = optional_param('commentid', -1, PARAM_INT);