From 977a52a0c7fb3cebc715534137ffba4028fdade9 Mon Sep 17 00:00:00 2001
From: Viliam Kopecky <vk@viliamkopecky.cz>
Date: Wed, 19 Sep 2018 11:28:49 +0200
Subject: [PATCH] WORDPRESS BUGFIX!!!
---
public/wp-includes/canonical.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/public/wp-includes/canonical.php b/public/wp-includes/canonical.php
index 03c51f1..304a6dd 100644
|
a
|
b
|
|
| 32 | 32 | * @global bool $is_IIS |
| 33 | 33 | * @global WP_Query $wp_query |
| 34 | 34 | * @global wpdb $wpdb WordPress database abstraction object. |
| 35 | | * @global WP $wp Current WordPress environment instance. |
| | 35 | * @global WP $wp Current WordPress environment instance. |
| 36 | 36 | * |
| 37 | 37 | * @param string $requested_url Optional. The URL that was requested, used to |
| 38 | 38 | * figure if redirect is needed. |
| … |
… |
function redirect_guess_404_permalink() { |
| 613 | 613 | $where = $wpdb->prepare("post_name LIKE %s", $wpdb->esc_like( get_query_var('name') ) . '%'); |
| 614 | 614 | |
| 615 | 615 | // if any of post_type, year, monthnum, or day are set, use them to refine the query |
| 616 | | if ( get_query_var('post_type') ) |
| 617 | | $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); |
| | 616 | if ( get_query_var('post_type') ) { |
| | 617 | $post_type = get_query_var('post_type'); |
| | 618 | if ( is_array($post_type) ) |
| | 619 | $where .= $wpdb->prepare(' AND post_type IN (' . implode(', ', array_fill(0, count($post_type), '%s')) . ')', $post_type); |
| | 620 | else |
| | 621 | $where .= $wpdb->prepare(" AND post_type = %s", $post_type); |
| | 622 | } |
| 618 | 623 | else |
| 619 | 624 | $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')"; |
| 620 | 625 | |