芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/www/wp-content/plugins/wordpress-seo-premium/src/helpers/current-page-helper.php
0 ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are casting to an integer, also this is a helper function. return (int) \wp_unslash( $_GET['post'] ); } return 0; } /** * Retrieves the current post type. * * @return string The post type. */ public function get_current_post_type() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. if ( isset( $_GET['post_type'] ) && \is_string( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. return \sanitize_text_field( \wp_unslash( $_GET['post_type'] ) ); } // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: should be done outside the helper function. if ( isset( $_POST['post_type'] ) && \is_string( $_POST['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: should be done outside the helper function. return \sanitize_text_field( \wp_unslash( $_POST['post_type'] ) ); } $post_id = $this->get_current_post_id(); if ( $post_id ) { return \get_post_type( $post_id ); } return 'post'; } /** * Retrieves the current taxonomy. * * @return string The taxonomy. */ public function get_current_taxonomy() { if ( ! isset( $_SERVER['REQUEST_METHOD'] ) || ! \in_array( $_SERVER['REQUEST_METHOD'], [ 'GET', 'POST' ], true ) ) { return ''; } // phpcs:ignore WordPress.Security.NonceVerification -- Reason: We are not processing form information. if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: should be done outside the helper function. if ( isset( $_POST['taxonomy'] ) && \is_string( $_POST['taxonomy'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: should be done outside the helper function. return \sanitize_text_field( \wp_unslash( $_POST['taxonomy'] ) ); } return ''; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. if ( isset( $_GET['taxonomy'] ) && \is_string( $_GET['taxonomy'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. return \sanitize_text_field( \wp_unslash( $_GET['taxonomy'] ) ); } return ''; } }