wn variables not to clean. * * Note: This is a Premium plugin-only hook. * * @since 19.2.0 * * @param array $allowed_extravars The list of the allowed vars (empty by default). */ $allowed_extravars = \apply_filters( 'Yoast\WP\SEO\allowlist_permalink_vars', [] ); if ( $this->options_helper->get( 'clean_permalinks_extra_variables' ) !== '' ) { $allowed_extravars = \array_merge( $allowed_extravars, \explode( ',', $this->options_helper->get( 'clean_permalinks_extra_variables' ) ) ); } $allowed_query = []; // @todo parse_str changes spaces in param names into `_`, we should find a better way to support them. \wp_parse_str( \wp_parse_url( $current_url, \PHP_URL_QUERY ), $query ); if ( ! empty( $allowed_extravars ) ) { foreach ( $allowed_extravars as $get ) { $get = \trim( $get ); if ( isset( $query[ $get ] ) ) { $allowed_query[ $get ] = \rawurlencode_deep( $query[ $get ] ); unset( $query[ $get ] ); } } } // If we had only allowed params, let's just bail out, no further processing needed. if ( \count( $query ) === 0 ) { return; } global $wp_query; $proper_url = ''; if ( \is_singular() ) { global $post; $proper_url = \get_permalink( $post->ID ); $page = \get_query_var( 'page' ); if ( $page && $page !== 1 ) { $the_post = \get_post( $post->ID ); $page_count = \substr_count( $the_post->post_content, '' ); $proper_url = \user_trailingslashit( \trailingslashit( $proper_url ) . $page ); if ( $page > ( $page_count + 1 ) ) { $proper_url = \user_trailingslashit( \trailingslashit( $proper_url ) . ( $page_count + 1 ) ); } } // Fix reply to comment links, whoever decided this should be a GET variable? // phpcs:ignore WordPress.Security -- We know this is scary. if ( isset( $_SERVER['REQUEST_URI'] ) && \preg_match( '`(\?replytocom=[^&]+)`', \sanitize_text_field( $_SERVER['REQUEST_URI'] ), $matches ) ) { $proper_url .= \str_replace( '?replytocom=', '#comment-', $matches[0] ); } unset( $matches ); // Prevent cleaning out posts & page previews for people capable of viewing them. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We know this is scary. if ( isset( $_GET['preview'] ) && isset( $_GET['preview_nonce'] ) && \current_user_can( 'edit_post' ) ) { return; } } elseif ( \is_front_page() ) { if ( $this->current_page_helper->is_home_posts_page() ) { $proper_url = \home_url( '/' ); } elseif ( $this->current_page_helper->is_home_static_page() ) { $proper_url = \get_permalink( $GLOBALS['post']->ID ); } } elseif ( $this->current_page_helper->is_posts_page() ) { $proper_url = \get_permalink( \get_option( 'page_for_posts' ) ); } elseif ( \is_category() || \is_tag() || \is_tax() ) { $term = $wp_query->get_queried_object(); if ( \is_feed() ) { $proper_url = \get_term_feed_link( $term->term_id, $term->taxonomy ); } else { $proper_url = \get_term_link( $term, $term->taxonomy ); } } elseif ( \is_search() ) { $s = \get_search_query(); $proper_url = \get_bloginfo( 'url' ) . '/?s=' . \rawurlencode( $s ); } elseif ( \is_404() ) { if ( \is_multisite() && ! \is_subdomain_install() && \is_main_site() ) { if ( $current_url === \get_bloginfo( 'url' ) . '/blog/' || $current_url === \get_bloginfo( 'url' ) . '/blog' ) { if ( $this->current_page_helper->is_home_static_page() ) { $proper_url = \get_permalink( \get_option( 'page_for_posts' ) ); } else { $proper_url = \get_bloginfo( 'url' ); } } } } if ( ! empty( $proper_url ) && $wp_query->query_vars['paged'] !== 0 && $wp_query->post_count !== 0 ) { if ( \is_search() ) { $proper_url = \get_bloginfo( 'url' ) . '/page/' . $wp_query->query_vars['paged'] . '/?s=' . \rawurlencode( \get_search_query() ); } else { $proper_url = \user_trailingslashit( \trailingslashit( $proper_url ) . 'page/' . $wp_query->query_vars['paged'] ); } } $proper_url = \add_query_arg( $allowed_query, $proper_url ); if ( ! empty( $proper_url ) && $current_url !== $proper_url ) { \header( 'Content-Type: redirect', true ); \header_remove( 'Content-Type' ); \header_remove( 'Last-Modified' ); \header_remove( 'X-Pingback' ); $message = \sprintf( /* translators: %1$s: Yoast SEO Premium */ \__( '%1$s: unregistered URL parameter removed', 'wordpress-seo-premium' ), 'Yoast SEO Premium' ); \wp_safe_redirect( $proper_url, 301, $message ); exit; } } } https://clinicalufer.com.br/post-sitemap.xml 2022-10-31T10:37:41+00:00 https://clinicalufer.com.br/page-sitemap.xml 2024-04-11T14:04:43+00:00 https://clinicalufer.com.br/category-sitemap.xml 2022-10-31T10:37:41+00:00 https://clinicalufer.com.br/author-sitemap.xml 2022-10-26T18:12:16+00:00