Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -83,12 +83,15 @@ class WPSEO_Custom_Fields_Plugin implements WPSEO_WordPress_Integration {
* @return WP_Post|array|null Returns a post if found, otherwise returns an empty array.
*/
protected function get_post() {
$post = filter_input( INPUT_GET, 'post' );
if ( isset( $post ) && $post !== false ) {
$post_id = (int) WPSEO_Utils::validate_int( $post );
return get_post( $post_id );
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Reason: We are not controlling the request.
if ( isset( $_GET['post'] ) && is_string( $_GET['post'] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are casting the unsafe value to an integer.
$post_id = (int) wp_unslash( $_GET['post'] );
if ( $post_id > 0 ) {
return get_post( $post_id );
}
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
if ( isset( $GLOBALS['post'] ) ) {
return $GLOBALS['post'];