Changeset 2795749
- Timestamp:
- 10/07/2022 05:08:18 PM (3 years ago)
- Location:
- rock-convert
- Files:
-
- 12 edited
-
tags/3.0.0/inc/admin/announcements/class-announcement.php (modified) (2 diffs)
-
tags/3.0.0/inc/admin/announcements/views/announcements-settings-page.php (modified) (1 diff)
-
tags/3.0.0/inc/admin/class-admin.php (modified) (1 diff)
-
tags/3.0.0/inc/admin/class-page-settings.php (modified) (4 diffs)
-
tags/3.0.0/inc/admin/class-utils.php (modified) (1 diff)
-
tags/3.0.0/inc/admin/cta/class-custom-meta-box.php (modified) (5 diffs)
-
trunk/inc/admin/announcements/class-announcement.php (modified) (2 diffs)
-
trunk/inc/admin/announcements/views/announcements-settings-page.php (modified) (1 diff)
-
trunk/inc/admin/class-admin.php (modified) (1 diff)
-
trunk/inc/admin/class-page-settings.php (modified) (4 diffs)
-
trunk/inc/admin/class-utils.php (modified) (1 diff)
-
trunk/inc/admin/cta/class-custom-meta-box.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rock-convert/tags/3.0.0/inc/admin/announcements/class-announcement.php
r2795270 r2795749 94 94 $activate = sanitize_key( Utils::getArrayValue( $_POST, 'rconvert_activate_announcement' ) ); 95 95 $link = esc_url_raw( Utils::getArrayValue( $_POST, 'rconvert_announcement_link' ) ); 96 $urls = Utils:: getArrayValue( $_POST, 'rconvert_announcement_excluded_pages');96 $urls = Utils::sanitize_array( $_POST['rconvert_announcement_excluded_pages'] ); 97 97 $position = sanitize_text_field( Utils::getArrayValue( $_POST, 'rconvert_announcement_position' ) ); 98 98 $text = sanitize_text_field( Utils::getArrayValue( $_POST, 'rconvert_announcement_text' ) ); … … 121 121 122 122 wp_safe_redirect( admin_url( '/edit.php?post_type=cta&page=rock-convert-announcements&success=true' ), 301 ); 123 exit; 123 124 } 124 125 } -
rock-convert/tags/3.0.0/inc/admin/announcements/views/announcements-settings-page.php
r2795270 r2795749 31 31 $position = Utils::getArrayValue( $settings, 'position', null, $default['position'] ); 32 32 $visibility = Utils::getArrayValue( $settings, 'visibility', null, $default['visibility'] ); 33 $excluded_urls = Utils:: getArrayValue( $settings, 'urls');33 $excluded_urls = Utils::sanitize_array( $settings['urls'] ); 34 34 $bg_color = Utils::getArrayValue( $settings, 'bg_color', null, $default['bg_color'] ); 35 35 $text_color = Utils::getArrayValue( $settings, 'text_color', null, $default['text_color'] ); -
rock-convert/tags/3.0.0/inc/admin/class-admin.php
r2795270 r2795749 254 254 public function add_support_submenu_link() { 255 255 global $submenu; 256 $submenu['edit.php?post_type=cta'][] = array( 'Ajuda', 'manage_options', ROCK_CONVERT_HELP_CENTER_URL ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride 256 $submenu['edit.php?post_type=cta'][] = array( 257 'Ajuda', 'manage_options', ROCK_CONVERT_HELP_CENTER_URL ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride 257 258 } 258 259 } -
rock-convert/tags/3.0.0/inc/admin/class-page-settings.php
r2795270 r2795749 143 143 update_option( 144 144 '_rock_convert_popup_color', 145 $popup_color145 sanitize_hex_color( $popup_color ) 146 146 ); 147 147 148 148 update_option( 149 149 '_rock_convert_popup_activate', 150 $popup_activate150 sanitize_text_field( $popup_activate ) 151 151 ); 152 152 153 153 update_option( 154 154 '_rock_convert_popup_image_activate', 155 $popup_image_activate155 sanitize_text_field( $popup_image_activate ) 156 156 ); 157 157 158 158 update_option( 159 159 '_rock_convert_popup_image', 160 $popup_image160 sanitize_text_field( $popup_image ) 161 161 ); 162 162 163 163 update_option( 164 164 '_rock_convert_popup_button_color', 165 $popup_button_color165 sanitize_hex_color( $popup_button_color ) 166 166 ); 167 167 168 168 update_option( 169 169 '_rock_convert_popup_title_color', 170 $popup_title_color170 sanitize_hex_color( $popup_title_color ) 171 171 ); 172 172 173 173 update_option( 174 174 '_rock_convert_popup_description_color', 175 $popup_description_color175 sanitize_hex_color( $popup_description_color ) 176 176 ); 177 177 178 178 update_option( 179 179 '_rock_convert_popup_button_text_color', 180 $popup_button_text_color180 sanitize_hex_color( $popup_button_text_color ) 181 181 ); 182 182 183 183 update_option( 184 184 '_rock_convert_popup_button_close_color', 185 $popup_button_close_color185 sanitize_hex_color( $popup_button_close_color ) 186 186 ); 187 187 } … … 205 205 $custom_field_label = Utils::getArrayValue( $_POST, 'rock_convert_custom_field_label' ); 206 206 207 update_option( '_rock_convert_name_field', $enable_name_field);208 update_option( '_rock_convert_custom_field', $enable_custom_field);209 update_option( '_rock_convert_custom_field_label', $custom_field_label);210 update_option( '_rock_convert_enable_analytics', $enable_analytics);207 update_option( '_rock_convert_name_field', sanitize_text_field( $enable_name_field ) ); 208 update_option( '_rock_convert_custom_field', sanitize_text_field( $enable_custom_field ) ); 209 update_option( '_rock_convert_custom_field_label', sanitize_text_field( $custom_field_label ) ); 210 update_option( '_rock_convert_enable_analytics', sanitize_text_field( $enable_analytics ) ); 211 211 } 212 212 } … … 271 271 update_option( 272 272 '_rock_convert_mailchimp_token', 273 $mailchimp_token273 sanitize_text_field( $mailchimp_token ) 274 274 ); 275 275 … … 279 279 update_option( 280 280 '_rock_convert_mailchimp_list', 281 $mailchimp_list281 sanitize_text_field( $mailchimp_list ) 282 282 ); 283 283 } -
rock-convert/tags/3.0.0/inc/admin/class-utils.php
r2795270 r2795749 61 61 } 62 62 63 return isset( $array[ $index ] ) ? $array[ $index ]: $default;63 return isset( $array[ $index ] ) ? sanitize_text_field( wp_unslash( $array[ $index ] ) ) : $default; 64 64 } 65 65 -
rock-convert/tags/3.0.0/inc/admin/cta/class-custom-meta-box.php
r2795270 r2795749 332 332 style="width: 65%;margin-right: 10px;" 333 333 value="<?php echo esc_url( $url ); ?>" 334 placeholder="<?php e sc_html_e( 'Exemplo', 'rock-convert' ); ?>:335 <?php echo esc_url( get_bloginfo( 'url' ) ); ?>/meu-post">334 placeholder="<?php echo esc_html( 'Exemplo', 'rock-convert' ) . ': ' 335 . esc_url( get_bloginfo( 'url' ) . '/meu-post' ); ?>"> 336 336 <input type="button" 337 337 class="preview button rock-convert-exclude-pages-remove" … … 345 345 <input type="text" name="rock_convert_exclude_pages[]" 346 346 style="width: 95%;margin-right: 10px;" 347 placeholder="<?php e sc_html_e( 'Exemplo', 'rock-convert' ); ?>:348 <?php echo esc_url( get_bloginfo( 'url' ) ); ?>/meu-post">347 placeholder="<?php echo esc_html( 'Exemplo', 'rock-convert' ) . ': ' 348 . esc_url( get_bloginfo( 'url' ) . '/meu-post' ); ?>"> 349 349 <input type="button" 350 350 class="preview button rock-convert-exclude-pages-remove" … … 543 543 544 544 $exclude_pages = isset( $_POST['rock_convert_exclude_pages'] ) ? 545 sanitize_text_field( wp_unslash( $_POST['rock_convert_exclude_pages'] ) ): null;545 $_POST['rock_convert_exclude_pages'] : null; 546 546 $urls = $exclude_pages ? Utils::sanitize_array( $exclude_pages ) : null; 547 547 … … 554 554 555 555 if ( ! empty( $urls ) ) { 556 update_post_meta( $post_id, '_rock_convert_excluded_urls', $urls );556 update_post_meta( $post_id, '_rock_convert_excluded_urls', $urls ); 557 557 } 558 558 559 // Update image field. 560 $image = array_map( 'intval', Utils::getArrayValue( $_POST, 'rock-convert-media' ) ); 561 if ( $image ) { 562 foreach ( $image as $key => $value ) { 563 update_post_meta( $post_id, $key, $value ); 559 $images = isset( $_POST['rock-convert-media'] ) ? Utils::sanitize_array( $_POST['rock-convert-media'] ) : null; 560 561 if( $images ){ 562 $image = array_map( 'intval', $images ); 563 foreach ( $image as $value ) { 564 update_post_meta( $post_id, '_rock_convert_image_media', $value ); 564 565 } 565 566 } … … 589 590 <input type='hidden' id='<?php echo esc_attr( $name ); ?>-value' 590 591 class='small-text' 591 name='rock-convert-media[ <?php echo esc_attr( $name ); ?>]'592 name='rock-convert-media[]' 592 593 value='<?php echo esc_attr( $value ); ?>' /> 593 594 <input type='button' id='<?php echo esc_attr( $name ); ?>' -
rock-convert/trunk/inc/admin/announcements/class-announcement.php
r2795270 r2795749 94 94 $activate = sanitize_key( Utils::getArrayValue( $_POST, 'rconvert_activate_announcement' ) ); 95 95 $link = esc_url_raw( Utils::getArrayValue( $_POST, 'rconvert_announcement_link' ) ); 96 $urls = Utils:: getArrayValue( $_POST, 'rconvert_announcement_excluded_pages');96 $urls = Utils::sanitize_array( $_POST['rconvert_announcement_excluded_pages'] ); 97 97 $position = sanitize_text_field( Utils::getArrayValue( $_POST, 'rconvert_announcement_position' ) ); 98 98 $text = sanitize_text_field( Utils::getArrayValue( $_POST, 'rconvert_announcement_text' ) ); … … 121 121 122 122 wp_safe_redirect( admin_url( '/edit.php?post_type=cta&page=rock-convert-announcements&success=true' ), 301 ); 123 exit; 123 124 } 124 125 } -
rock-convert/trunk/inc/admin/announcements/views/announcements-settings-page.php
r2795270 r2795749 31 31 $position = Utils::getArrayValue( $settings, 'position', null, $default['position'] ); 32 32 $visibility = Utils::getArrayValue( $settings, 'visibility', null, $default['visibility'] ); 33 $excluded_urls = Utils:: getArrayValue( $settings, 'urls');33 $excluded_urls = Utils::sanitize_array( $settings['urls'] ); 34 34 $bg_color = Utils::getArrayValue( $settings, 'bg_color', null, $default['bg_color'] ); 35 35 $text_color = Utils::getArrayValue( $settings, 'text_color', null, $default['text_color'] ); -
rock-convert/trunk/inc/admin/class-admin.php
r2795270 r2795749 254 254 public function add_support_submenu_link() { 255 255 global $submenu; 256 $submenu['edit.php?post_type=cta'][] = array( 'Ajuda', 'manage_options', ROCK_CONVERT_HELP_CENTER_URL ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride 256 $submenu['edit.php?post_type=cta'][] = array( 257 'Ajuda', 'manage_options', ROCK_CONVERT_HELP_CENTER_URL ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride 257 258 } 258 259 } -
rock-convert/trunk/inc/admin/class-page-settings.php
r2795270 r2795749 143 143 update_option( 144 144 '_rock_convert_popup_color', 145 $popup_color145 sanitize_hex_color( $popup_color ) 146 146 ); 147 147 148 148 update_option( 149 149 '_rock_convert_popup_activate', 150 $popup_activate150 sanitize_text_field( $popup_activate ) 151 151 ); 152 152 153 153 update_option( 154 154 '_rock_convert_popup_image_activate', 155 $popup_image_activate155 sanitize_text_field( $popup_image_activate ) 156 156 ); 157 157 158 158 update_option( 159 159 '_rock_convert_popup_image', 160 $popup_image160 sanitize_text_field( $popup_image ) 161 161 ); 162 162 163 163 update_option( 164 164 '_rock_convert_popup_button_color', 165 $popup_button_color165 sanitize_hex_color( $popup_button_color ) 166 166 ); 167 167 168 168 update_option( 169 169 '_rock_convert_popup_title_color', 170 $popup_title_color170 sanitize_hex_color( $popup_title_color ) 171 171 ); 172 172 173 173 update_option( 174 174 '_rock_convert_popup_description_color', 175 $popup_description_color175 sanitize_hex_color( $popup_description_color ) 176 176 ); 177 177 178 178 update_option( 179 179 '_rock_convert_popup_button_text_color', 180 $popup_button_text_color180 sanitize_hex_color( $popup_button_text_color ) 181 181 ); 182 182 183 183 update_option( 184 184 '_rock_convert_popup_button_close_color', 185 $popup_button_close_color185 sanitize_hex_color( $popup_button_close_color ) 186 186 ); 187 187 } … … 205 205 $custom_field_label = Utils::getArrayValue( $_POST, 'rock_convert_custom_field_label' ); 206 206 207 update_option( '_rock_convert_name_field', $enable_name_field);208 update_option( '_rock_convert_custom_field', $enable_custom_field);209 update_option( '_rock_convert_custom_field_label', $custom_field_label);210 update_option( '_rock_convert_enable_analytics', $enable_analytics);207 update_option( '_rock_convert_name_field', sanitize_text_field( $enable_name_field ) ); 208 update_option( '_rock_convert_custom_field', sanitize_text_field( $enable_custom_field ) ); 209 update_option( '_rock_convert_custom_field_label', sanitize_text_field( $custom_field_label ) ); 210 update_option( '_rock_convert_enable_analytics', sanitize_text_field( $enable_analytics ) ); 211 211 } 212 212 } … … 271 271 update_option( 272 272 '_rock_convert_mailchimp_token', 273 $mailchimp_token273 sanitize_text_field( $mailchimp_token ) 274 274 ); 275 275 … … 279 279 update_option( 280 280 '_rock_convert_mailchimp_list', 281 $mailchimp_list281 sanitize_text_field( $mailchimp_list ) 282 282 ); 283 283 } -
rock-convert/trunk/inc/admin/class-utils.php
r2795270 r2795749 61 61 } 62 62 63 return isset( $array[ $index ] ) ? $array[ $index ]: $default;63 return isset( $array[ $index ] ) ? sanitize_text_field( wp_unslash( $array[ $index ] ) ) : $default; 64 64 } 65 65 -
rock-convert/trunk/inc/admin/cta/class-custom-meta-box.php
r2795270 r2795749 332 332 style="width: 65%;margin-right: 10px;" 333 333 value="<?php echo esc_url( $url ); ?>" 334 placeholder="<?php e sc_html_e( 'Exemplo', 'rock-convert' ); ?>:335 <?php echo esc_url( get_bloginfo( 'url' ) ); ?>/meu-post">334 placeholder="<?php echo esc_html( 'Exemplo', 'rock-convert' ) . ': ' 335 . esc_url( get_bloginfo( 'url' ) . '/meu-post' ); ?>"> 336 336 <input type="button" 337 337 class="preview button rock-convert-exclude-pages-remove" … … 345 345 <input type="text" name="rock_convert_exclude_pages[]" 346 346 style="width: 95%;margin-right: 10px;" 347 placeholder="<?php e sc_html_e( 'Exemplo', 'rock-convert' ); ?>:348 <?php echo esc_url( get_bloginfo( 'url' ) ); ?>/meu-post">347 placeholder="<?php echo esc_html( 'Exemplo', 'rock-convert' ) . ': ' 348 . esc_url( get_bloginfo( 'url' ) . '/meu-post' ); ?>"> 349 349 <input type="button" 350 350 class="preview button rock-convert-exclude-pages-remove" … … 543 543 544 544 $exclude_pages = isset( $_POST['rock_convert_exclude_pages'] ) ? 545 sanitize_text_field( wp_unslash( $_POST['rock_convert_exclude_pages'] ) ): null;545 $_POST['rock_convert_exclude_pages'] : null; 546 546 $urls = $exclude_pages ? Utils::sanitize_array( $exclude_pages ) : null; 547 547 … … 554 554 555 555 if ( ! empty( $urls ) ) { 556 update_post_meta( $post_id, '_rock_convert_excluded_urls', $urls );556 update_post_meta( $post_id, '_rock_convert_excluded_urls', $urls ); 557 557 } 558 558 559 // Update image field. 560 $image = array_map( 'intval', Utils::getArrayValue( $_POST, 'rock-convert-media' ) ); 561 if ( $image ) { 562 foreach ( $image as $key => $value ) { 563 update_post_meta( $post_id, $key, $value ); 559 $images = isset( $_POST['rock-convert-media'] ) ? Utils::sanitize_array( $_POST['rock-convert-media'] ) : null; 560 561 if( $images ){ 562 $image = array_map( 'intval', $images ); 563 foreach ( $image as $value ) { 564 update_post_meta( $post_id, '_rock_convert_image_media', $value ); 564 565 } 565 566 } … … 589 590 <input type='hidden' id='<?php echo esc_attr( $name ); ?>-value' 590 591 class='small-text' 591 name='rock-convert-media[ <?php echo esc_attr( $name ); ?>]'592 name='rock-convert-media[]' 592 593 value='<?php echo esc_attr( $value ); ?>' /> 593 594 <input type='button' id='<?php echo esc_attr( $name ); ?>'
Note: See TracChangeset
for help on using the changeset viewer.