Changeset 2292422
- Timestamp:
- 04/27/2020 08:24:23 AM (6 years ago)
- Location:
- wp-advanced-search
- Files:
-
- 8 edited
-
tags/3.3.7/WP-Advanced-Search-Function.php (modified) (3 diffs)
-
tags/3.3.7/WP-Advanced-Search-Options.php (modified) (3 diffs)
-
tags/3.3.7/WP-Advanced-Search-Styles.php (modified) (1 diff)
-
tags/3.3.7/class.inc/ajaxResults.php (modified) (4 diffs)
-
trunk/WP-Advanced-Search-Function.php (modified) (3 diffs)
-
trunk/WP-Advanced-Search-Options.php (modified) (3 diffs)
-
trunk/WP-Advanced-Search-Styles.php (modified) (1 diff)
-
trunk/class.inc/ajaxResults.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-advanced-search/tags/3.3.7/WP-Advanced-Search-Function.php
r2289895 r2292422 64 64 // Lancement de la fonction de remplissage automatique de l'index inversé (si activé) 65 65 if($select->autoCompleteGenerate == true) { 66 $autocompletion->autoComplete(stripslashes( $_GET[$nameSearch]), $select->autoCompleteSizeMin);66 $autocompletion->autoComplete(stripslashes(sanitize_text_field($_GET[$nameSearch])), $select->autoCompleteSizeMin); 67 67 } 68 68 } … … 99 99 100 100 // Lancement du moteur de recherche 101 $moteur = new moteurRecherche($wpdb, stripslashes( $_GET[$nameSearch]), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent);101 $moteur = new moteurRecherche($wpdb, stripslashes(sanitize_text_field($_GET[$nameSearch])), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent); 102 102 $moteur->moteurRequetes($colonnesWhere); 103 103 … … 149 149 $output = ''; 150 150 $nb = 0; 151 if(isset($_GET['page']) ) {151 if(isset($_GET['page']) && is_numeric($_GET['page'])) { 152 152 $nb = $nb + ($select->NumberPerPage * ($_GET['page']-1)); 153 153 } -
wp-advanced-search/tags/3.3.7/WP-Advanced-Search-Options.php
r2289895 r2292422 49 49 $wp_advanced_search_categories = array(); 50 50 foreach($_POST['wp_advanced_search_categories'] as $ctgSave) { 51 array_push($wp_advanced_search_categories, $ctgSave);51 array_push($wp_advanced_search_categories, sanitize_text_field($ctgSave)); 52 52 } 53 53 if(is_numeric($_POST['wp_advanced_search_numberPerPage']) || !empty($_POST['wp_advanced_search_numberPerPage'])) { … … 99 99 // Déclencher la fonction de mise à jour (upload) 100 100 if(isset($_POST['wp_advanced_search_action']) && $_POST['wp_advanced_search_action'] == __('Enregistrer' , 'wp-advanced-search')) { 101 WP_Advanced_Search_update(); 101 if(isset($_POST['wp_advanced_search_update_nonce'])) { 102 if(wp_verify_nonce($_POST['wp_advanced_search_update_nonce'], 'wp_advanced_search_update_nonce')) { 103 WP_Advanced_Search_update(); 104 } 105 } 102 106 } 103 107 … … 333 337 </div> 334 338 <p class="clear"></p> 339 <?php if(current_user_can('edit_posts') && is_admin()) { ?> 340 <input type="hidden" name="wp_advanced_search_update_nonce" value="<?php echo wp_create_nonce('wp_advanced_search_update_nonce'); ?>"/> 341 <?php } ?> 335 342 <p><input type="submit" name="wp_advanced_search_action" class="button-primary" value="<?php _e('Enregistrer' , 'wp-advanced-search'); ?>" /></p> 336 343 </div> -
wp-advanced-search/tags/3.3.7/WP-Advanced-Search-Styles.php
r2289895 r2292422 43 43 <label for="wp_advanced_search_dateOK"><strong><?php _e('Affichage de la date ?','wp-advanced-search'); ?></strong></label> 44 44 </p> 45 <p class="tr">45 <p class="tr"> 46 46 <select name="wp_advanced_search_authorOK" id="wp_advanced_search_authorOK"> 47 47 <option value="1" <?php if($select->AuthorOK == true) { echo 'selected="selected"'; } ?>><?php _e('Oui','wp-advanced-search'); ?></option> -
wp-advanced-search/tags/3.3.7/class.inc/ajaxResults.php
r2289895 r2292422 62 62 63 63 // Lancement du moteur de recherche 64 $moteur = new moteurRecherche($wpdb, stripslashes( $_GET[$nameSearch]), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent);64 $moteur = new moteurRecherche($wpdb, stripslashes(sanitize_text_field($_GET[$nameSearch])), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent); 65 65 $moteur->moteurRequetes($colonnesWhere); 66 66 … … 454 454 455 455 // Nombre de résultats par "tranche d'affichage" 456 $limit = htmlspecialchars($_GET['limit']);456 $limit = (is_numeric($_GET['limit'])) ? intval($_GET['limit']) : 0; 457 457 458 458 /*-------------------------------------------------------*/ … … 461 461 462 462 // Numéro de page récupéré dynamiquement 463 if(isset($_GET['nb']) ) {464 $page = htmlspecialchars($_GET['nb']);463 if(isset($_GET['nb']) && is_numeric($_GET['nb'])) { 464 $page = intval($_GET['nb']); 465 465 } else { 466 466 $page = 0; … … 468 468 469 469 // Lancement de la fonction d'affichage 470 $moteur->moteurAffichage('affichage', '', array(true, htmlspecialchars($_GET['nb']), htmlspecialchars($select->paginationNbLimit), false), array($select->OrderOK, $select->OrderColumn, $select->AscDesc), array($select->AlgoOK,'algo','DESC','ID'), $wpAdaptation, $conditions);470 $moteur->moteurAffichage('affichage', '', array(true, intval($_GET['nb']), htmlspecialchars($select->paginationNbLimit), false), array($select->OrderOK, $select->OrderColumn, $select->AscDesc), array($select->AlgoOK,'algo','DESC','ID'), $wpAdaptation, $conditions); 471 471 } 472 472 -
wp-advanced-search/trunk/WP-Advanced-Search-Function.php
r2255724 r2292422 64 64 // Lancement de la fonction de remplissage automatique de l'index inversé (si activé) 65 65 if($select->autoCompleteGenerate == true) { 66 $autocompletion->autoComplete(stripslashes( $_GET[$nameSearch]), $select->autoCompleteSizeMin);66 $autocompletion->autoComplete(stripslashes(sanitize_text_field($_GET[$nameSearch])), $select->autoCompleteSizeMin); 67 67 } 68 68 } … … 99 99 100 100 // Lancement du moteur de recherche 101 $moteur = new moteurRecherche($wpdb, stripslashes( $_GET[$nameSearch]), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent);101 $moteur = new moteurRecherche($wpdb, stripslashes(sanitize_text_field($_GET[$nameSearch])), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent); 102 102 $moteur->moteurRequetes($colonnesWhere); 103 103 … … 149 149 $output = ''; 150 150 $nb = 0; 151 if(isset($_GET['page']) ) {151 if(isset($_GET['page']) && is_numeric($_GET['page'])) { 152 152 $nb = $nb + ($select->NumberPerPage * ($_GET['page']-1)); 153 153 } -
wp-advanced-search/trunk/WP-Advanced-Search-Options.php
r2275171 r2292422 49 49 $wp_advanced_search_categories = array(); 50 50 foreach($_POST['wp_advanced_search_categories'] as $ctgSave) { 51 array_push($wp_advanced_search_categories, $ctgSave);51 array_push($wp_advanced_search_categories, sanitize_text_field($ctgSave)); 52 52 } 53 53 if(is_numeric($_POST['wp_advanced_search_numberPerPage']) || !empty($_POST['wp_advanced_search_numberPerPage'])) { … … 99 99 // Déclencher la fonction de mise à jour (upload) 100 100 if(isset($_POST['wp_advanced_search_action']) && $_POST['wp_advanced_search_action'] == __('Enregistrer' , 'wp-advanced-search')) { 101 WP_Advanced_Search_update(); 101 if(isset($_POST['wp_advanced_search_update_nonce'])) { 102 if(wp_verify_nonce($_POST['wp_advanced_search_update_nonce'], 'wp_advanced_search_update_nonce')) { 103 WP_Advanced_Search_update(); 104 } 105 } 102 106 } 103 107 … … 333 337 </div> 334 338 <p class="clear"></p> 339 <?php if(current_user_can('edit_posts') && is_admin()) { ?> 340 <input type="hidden" name="wp_advanced_search_update_nonce" value="<?php echo wp_create_nonce('wp_advanced_search_update_nonce'); ?>"/> 341 <?php } ?> 335 342 <p><input type="submit" name="wp_advanced_search_action" class="button-primary" value="<?php _e('Enregistrer' , 'wp-advanced-search'); ?>" /></p> 336 343 </div> -
wp-advanced-search/trunk/WP-Advanced-Search-Styles.php
r2275171 r2292422 43 43 <label for="wp_advanced_search_dateOK"><strong><?php _e('Affichage de la date ?','wp-advanced-search'); ?></strong></label> 44 44 </p> 45 <p class="tr">45 <p class="tr"> 46 46 <select name="wp_advanced_search_authorOK" id="wp_advanced_search_authorOK"> 47 47 <option value="1" <?php if($select->AuthorOK == true) { echo 'selected="selected"'; } ?>><?php _e('Oui','wp-advanced-search'); ?></option> -
wp-advanced-search/trunk/class.inc/ajaxResults.php
r2275099 r2292422 62 62 63 63 // Lancement du moteur de recherche 64 $moteur = new moteurRecherche($wpdb, stripslashes( $_GET[$nameSearch]), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent);64 $moteur = new moteurRecherche($wpdb, stripslashes(sanitize_text_field($_GET[$nameSearch])), $table, $typeRecherche, $stopwords, $exclusion, $encoding, $exact, $accent); 65 65 $moteur->moteurRequetes($colonnesWhere); 66 66 … … 454 454 455 455 // Nombre de résultats par "tranche d'affichage" 456 $limit = htmlspecialchars($_GET['limit']);456 $limit = (is_numeric($_GET['limit'])) ? intval($_GET['limit']) : 0; 457 457 458 458 /*-------------------------------------------------------*/ … … 461 461 462 462 // Numéro de page récupéré dynamiquement 463 if(isset($_GET['nb']) ) {464 $page = htmlspecialchars($_GET['nb']);463 if(isset($_GET['nb']) && is_numeric($_GET['nb'])) { 464 $page = intval($_GET['nb']); 465 465 } else { 466 466 $page = 0; … … 468 468 469 469 // Lancement de la fonction d'affichage 470 $moteur->moteurAffichage('affichage', '', array(true, htmlspecialchars($_GET['nb']), htmlspecialchars($select->paginationNbLimit), false), array($select->OrderOK, $select->OrderColumn, $select->AscDesc), array($select->AlgoOK,'algo','DESC','ID'), $wpAdaptation, $conditions);470 $moteur->moteurAffichage('affichage', '', array(true, intval($_GET['nb']), htmlspecialchars($select->paginationNbLimit), false), array($select->OrderOK, $select->OrderColumn, $select->AscDesc), array($select->AlgoOK,'algo','DESC','ID'), $wpAdaptation, $conditions); 471 471 } 472 472
Note: See TracChangeset
for help on using the changeset viewer.