Changeset 2835253
- Timestamp:
- 12/16/2022 08:21:09 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-contentools/tags/3.1.0/includes/class-contentools-rest.php
r2833993 r2835253 209 209 ); 210 210 211 header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL']: 'HTTP/1.0') . ' ' . $status . ' ' . $statuses[$status]);211 header((isset($_SERVER['SERVER_PROTOCOL']) ? sanitize_text_field($_SERVER['SERVER_PROTOCOL']) : 'HTTP/1.0') . ' ' . $status . ' ' . $statuses[$status]); 212 212 213 213 header('Content-Type:application/json; charset=UTF-8'); … … 254 254 } 255 255 256 $php_auth_user = sanitize_user($_SERVER['PHP_AUTH_USER']); 257 256 258 if (!isset($_SERVER['PHP_AUTH_USER']) && (isset($_SERVER['HTTP_AUTHORIZATION']) || isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']))) { 257 259 258 260 if (isset($_SERVER['HTTP_AUTHORIZATION'])) { 259 261 260 $header = $_SERVER['HTTP_AUTHORIZATION'];262 $header = sanitize_text_field($_SERVER['HTTP_AUTHORIZATION']); 261 263 262 264 } else { 263 265 264 $header = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];266 $header = sanitize_text_field($_SERVER['REDIRECT_HTTP_AUTHORIZATION']); 265 267 266 268 } … … 268 270 if (!empty($header)) { 269 271 270 list($ _SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($header, 6)));272 list($php_auth_user, $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($header, 6))); 271 273 272 274 } … … 281 283 } 282 284 283 $username = $ _SERVER['PHP_AUTH_USER'];285 $username = $php_auth_user; 284 286 $password = $_SERVER['PHP_AUTH_PW']; 285 287 … … 651 653 652 654 if (isset($_POST["author"])) { 653 $attachment['post_author'] = intval($_POST['author']);655 $attachment['post_author'] = sanitize_key($_POST['author']); 654 656 } 655 657 … … 669 671 670 672 if (isset($_POST["post"])) { 671 $attachment['post_parent'] = intval($_POST['post']) || null;673 $attachment['post_parent'] = sanitize_key($_POST['post']); 672 674 } 673 675
Note: See TracChangeset
for help on using the changeset viewer.