Skip to content

Commit

Permalink
Slugs: handle custom query var as array (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
spleen1981 committed Jul 19, 2022
1 parent 14bddf9 commit fac7971
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/slugs/qtx_module_slugs.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,11 @@ private function get_last_slash( $slug ) {
private function get_page_id_by_path( $page_path, $post_type = 'page' ) {
global $wpdb;

// Handle cases where custom query vars with the same names of specific internal query vars (e.g. 'name') are structured as arrays for any reason.
if ( ! is_scalar( $page_path ) ) {
return null;
}

$page_path = rawurlencode( urldecode( $page_path ) );
$page_path = str_replace( '%2F', '/', $page_path );
$page_path = str_replace( '%20', ' ', $page_path );
Expand Down

0 comments on commit fac7971

Please sign in to comment.