← All changes
|
includes/upgrades/class-charitable-upgrade-page.php
+37
-6
1.7.0
→
1.8.13
View file →
| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Upgrade_Page |
| 6 | 6 | * @version 1.3.0 |
| 7 | 7 | * @author David Bisset |
| 8 | - * @copyright Copyright (c) 2022, WP Charitable LLC | |
| 8 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 9 | 9 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| @@ -95,17 +95,20 @@ | ||
| 95 | 95 | /** |
| 96 | 96 | * Return the current upgrade action. |
| 97 | 97 | * |
| 98 | 98 | * @since 1.3.0 |
| 99 | + * @version 1.8.9.1 | |
| 99 | 100 | * |
| 100 | 101 | * @return false|string False if no action was specified. |
| 101 | 102 | */ |
| 102 | 103 | public function get_action() { |
| 104 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 103 | 105 | if ( ! isset( $_GET['charitable-upgrade'] ) ) { |
| 104 | 106 | return false; |
| 105 | 107 | } |
| 106 | 108 | |
| 107 | - return sanitize_text_field( $_GET['charitable-upgrade'] ); | |
| 109 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 110 | + return sanitize_text_field( wp_unslash( $_GET['charitable-upgrade'] ) ); | |
| 108 | 111 | } |
| 109 | 112 | |
| 110 | 113 | /** |
| 111 | 114 | * Return the current upgrade step. |
| @@ -110,17 +113,20 @@ | ||
| 110 | 113 | /** |
| 111 | 114 | * Return the current upgrade step. |
| 112 | 115 | * |
| 113 | 116 | * @since 1.3.0 |
| 117 | + * @version 1.8.9.1 | |
| 114 | 118 | * |
| 115 | 119 | * @return int |
| 116 | 120 | */ |
| 117 | 121 | public function get_step() { |
| 122 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 118 | 123 | if ( ! isset( $_GET['step'] ) ) { |
| 119 | 124 | return 1; |
| 120 | 125 | } |
| 121 | 126 | |
| 122 | - return absint( $_GET['step'] ); | |
| 127 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 128 | + return absint( wp_unslash( $_GET['step'] ) ); | |
| 123 | 129 | } |
| 124 | 130 | |
| 125 | 131 | /** |
| 126 | 132 | * Return the total number of records to be updated. |
| @@ -125,33 +131,58 @@ | ||
| 125 | 131 | /** |
| 126 | 132 | * Return the total number of records to be updated. |
| 127 | 133 | * |
| 128 | 134 | * @since 1.3.0 |
| 135 | + * @version 1.8.9.1 | |
| 129 | 136 | * |
| 130 | 137 | * @return false|int |
| 131 | 138 | */ |
| 132 | 139 | public function get_total() { |
| 140 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 133 | 141 | if ( ! isset( $_GET['total'] ) ) { |
| 134 | 142 | return false; |
| 135 | 143 | } |
| 136 | 144 | |
| 137 | - return absint( $_GET['total'] ); | |
| 145 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 146 | + return absint( wp_unslash( $_GET['total'] ) ); | |
| 138 | 147 | } |
| 139 | 148 | |
| 140 | 149 | /** |
| 141 | - * Return the | |
| 150 | + * Return the... number? | |
| 142 | 151 | * |
| 143 | 152 | * @since 1.3.0 |
| 153 | + * @version 1.8.9.1 | |
| 144 | 154 | * |
| 145 | 155 | * @return int |
| 146 | 156 | */ |
| 147 | 157 | public function get_number() { |
| 158 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 148 | 159 | if ( ! isset( $_GET['number'] ) ) { |
| 149 | 160 | return 100; |
| 150 | 161 | } |
| 151 | 162 | |
| 152 | - return absint( $_GET['number'] ); | |
| 163 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 164 | + return absint( wp_unslash( $_GET['number'] ) ); | |
| 153 | 165 | } |
| 166 | + | |
| 167 | + /** | |
| 168 | + * Return the nonce | |
| 169 | + * | |
| 170 | + * @since 1.8.1 | |
| 171 | + * @version 1.8.9.1 | |
| 172 | + * | |
| 173 | + * @return false|string | |
| 174 | + */ | |
| 175 | + public function get_nonce() { | |
| 176 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 177 | + if ( ! isset( $_GET['nonce'] ) ) { | |
| 178 | + return false; | |
| 179 | + } | |
| 180 | + | |
| 181 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter | |
| 182 | + return sanitize_text_field( wp_unslash( $_GET['nonce'] ) ); | |
| 183 | + } | |
| 184 | + | |
| 154 | 185 | |
| 155 | 186 | /** |
| 156 | 187 | * Return the total number of steps. |
| 157 | 188 | * |