Changeset 1288172
- Timestamp:
- 11/17/2015 06:56:23 PM (10 years ago)
- Location:
- mtouch-quiz/trunk
- Files:
-
- 6 edited
-
mtouchquiz.php (modified) (2 diffs)
-
question.php (modified) (1 diff)
-
question_form.php (modified) (1 diff)
-
quiz.php (modified) (1 diff)
-
quiz_action.php (modified) (1 diff)
-
quiz_form.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mtouch-quiz/trunk/mtouchquiz.php
r960145 r1288172 104 104 '; 105 105 if ($_POST['mtq_hidden'] == 'Y') { 106 //process form 107 update_option('mtouchquiz_leftdelimit', $_REQUEST['left_delimiter']); 108 update_option('mtouchquiz_rightdelimit', $_REQUEST['right_delimiter']); 109 if(!empty($_POST['showalerts'])) { 110 update_option('mtouchquiz_showalerts', $_POST['showalerts']); 111 } else 112 { 113 update_option('mtouchquiz_showalerts', 0); 106 if (check_admin_referer('mtq_options_form')) { 107 //process form 108 update_option('mtouchquiz_leftdelimit', $_REQUEST['left_delimiter']); 109 update_option('mtouchquiz_rightdelimit', $_REQUEST['right_delimiter']); 110 if(!empty($_POST['showalerts'])) { 111 update_option('mtouchquiz_showalerts', $_POST['showalerts']); 112 } else 113 { 114 update_option('mtouchquiz_showalerts', 0); 115 } 116 117 if(!empty($_POST['show_support'])) { 118 update_option('mtouchquiz_show_support', "false"); 119 } else 120 { 121 update_option('mtouchquiz_show_support', "true"); 122 } 123 wpframe_message(__('Options updated', 'mtouchquiz')); 114 124 } 115 116 if(!empty($_POST['show_support'])) {117 update_option('mtouchquiz_show_support', "false");118 } else119 {120 update_option('mtouchquiz_show_support', "true");121 }122 wpframe_message(__('Options updated', 'mtouchquiz'));123 125 } 124 126 ?> … … 163 165 <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'mtouchquiz') ?>" /> 164 166 </p> 167 <?php wp_nonce_field('mtq_options_form'); ?> 165 168 </form> 166 169 <br /> -
mtouch-quiz/trunk/question.php
r960145 r1288172 6 6 if($_REQUEST['action'] == 'edit') $action = 'edit'; 7 7 8 if(isset($_REQUEST['submit']) ) {8 if(isset($_REQUEST['submit']) && check_admin_referer('mtq_question_form') ) { 9 9 $correct_answers = $_REQUEST['correct_answer']; 10 10 $num_correct = count($correct_answers); -
mtouch-quiz/trunk/question_form.php
r350146 r1288172 200 200 <?php _e("Go to Questions Page", 'mtouchquiz') ?> 201 201 </a> </div> 202 <?php wp_nonce_field('mtq_question_form'); ?> 202 203 </form> 203 204 </div> -
mtouch-quiz/trunk/quiz.php
r423456 r1288172 47 47 ?> 48 48 <th scope="row" style="text-align: center;"><?php echo $quiz->ID ?></th> 49 <td><?php echo stripslashes( $quiz->name)?></td>49 <td><?php echo stripslashes(sanitize_text_field($quiz->name))?></td> 50 50 <td><?php echo $quiz->question_count ?></td> 51 51 <td><?php echo date(get_option('date_format') . ' ' . get_option('time_format'), strtotime($quiz->added_on)) ?></td> -
mtouch-quiz/trunk/quiz_action.php
r415566 r1288172 25 25 if($_REQUEST['action'] == 'edit') { //Update goes here 26 26 27 $wpdb->get_results($wpdb->prepare("UPDATE {$wpdb->prefix}mtouchquiz_quiz SET name=%s, description=%s,final_screen=%s,answer_mode=%s,single_page=%s, show_hints=%s, show_start=%s, show_final=%s, multiple_chances=%s, random_questions=%s, random_answers=%s, form_code=%s, time_limit=%s WHERE ID=%d", $_REQUEST['name'], $_REQUEST['description'], $_REQUEST['content'], $answer_mode, $single_page, $show_hints, $show_start, $show_final,$multiple_chances, $random_questions, $random_answers,$_REQUEST['gravity'],$_REQUEST['mtq_timer'],$_REQUEST['quiz']));27 $wpdb->get_results($wpdb->prepare("UPDATE {$wpdb->prefix}mtouchquiz_quiz SET name=%s, description=%s,final_screen=%s,answer_mode=%s,single_page=%s, show_hints=%s, show_start=%s, show_final=%s, multiple_chances=%s, random_questions=%s, random_answers=%s, form_code=%s, time_limit=%s WHERE ID=%d", sanitize_text_field($_REQUEST['name']), $_REQUEST['description'], $_REQUEST['content'], $answer_mode, $single_page, $show_hints, $show_start, $show_final,$multiple_chances, $random_questions, $random_answers,$_REQUEST['gravity'],$_REQUEST['mtq_timer'],$_REQUEST['quiz'])); 28 28 29 29 wp_redirect($wpframe_home . '/wp-admin/admin.php?page=mtouch-quiz/quiz.php&message=updated'); -
mtouch-quiz/trunk/quiz_form.php
r960145 r1288172 8 8 $dquiz = array(); 9 9 if($action == 'edit') { 10 $dquiz = $wpdb->get_row($wpdb->prepare("SELECT name,description,final_screen,answer_mode,single_page,show_hints,show_start, show_final,multiple_chances,random_questions,random_answers FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $_REQUEST['quiz'])); 10 $clean_quiz = intval($_REQUEST['quiz']); 11 $dquiz = $wpdb->get_row($wpdb->prepare("SELECT name,description,final_screen,answer_mode,single_page,show_hints,show_start, show_final,multiple_chances,random_questions,random_answers FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $clean_quiz)); 11 12 $final_screen = stripslashes($dquiz->final_screen); 12 13 $answer_display = stripslashes($dquiz->answer_mode); … … 18 19 $random_questions = stripslashes($dquiz->random_questions); 19 20 $random_answers = stripslashes($dquiz->random_answers); 20 $dquizfm = $wpdb->get_row($wpdb->prepare("SELECT form_code FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $ _REQUEST['quiz']));21 $dquizfm = $wpdb->get_row($wpdb->prepare("SELECT form_code FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $clean_quiz)); 21 22 $form_code = stripslashes($dquizfm->form_code); 22 $tquizfm = $wpdb->get_row($wpdb->prepare("SELECT time_limit FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $ _REQUEST['quiz']));23 $tquizfm = $wpdb->get_row($wpdb->prepare("SELECT time_limit FROM {$wpdb->prefix}mtouchquiz_quiz WHERE ID=%d", $clean_quiz)); 23 24 $mtq_time = stripslashes($tquizfm->time_limit); 24 25 } else { … … 208 209 209 210 if ($action == 'edit') { 210 $all_ratings = $wpdb->get_results($wpdb->prepare("SELECT score_rating, min_points FROM {$wpdb->prefix}mtouchquiz_ratings WHERE quiz_id=%d ORDER BY min_points", $_REQUEST['quiz']));211 $all_ratings = $wpdb->get_results($wpdb->prepare("SELECT score_rating, min_points FROM {$wpdb->prefix}mtouchquiz_ratings WHERE quiz_id=%d ORDER BY min_points", intval($_REQUEST['quiz']))); 211 212 } 212 213 $default_ratings = array(0,40,60,80,100); … … 373 374 <?php wp_nonce_field('mtq_create_edit_quiz'); ?> 374 375 <input type="hidden" name="action" value="<?php echo $action; ?>" /> 375 <input type="hidden" name="quiz" value="<?php echo $_REQUEST['quiz']; ?>" />376 <input type="hidden" name="quiz" value="<?php echo intval($_REQUEST['quiz']); ?>" /> 376 377 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 377 378 <span id="autosave"></span>
Note: See TracChangeset
for help on using the changeset viewer.