Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTS: fix to handle esc_sql() 4.8.3 breaking change #1157

Merged
merged 3 commits into from
May 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions modules/slugs/includes/class-qtranslate-slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,16 @@ private function get_page_id_by_path( $page_path, $output = OBJECT, $post_type =
$page_path = str_replace( '%2F', '/', $page_path );
$page_path = str_replace( '%20', ' ', $page_path );
$parts = explode( '/', trim( $page_path, '/' ) );
$parts = array_map( 'esc_sql', $parts );
$parts = array_map( 'sanitize_title_for_query', $parts );
$parts = array_map(
function ( $a ) {
global $wpdb;
return sanitize_title_for_query(
$wpdb->remove_placeholder_escape(
esc_sql( $a )
)
);
},
$parts );
$in_string = "'" . implode( "','", $parts ) . "'";
$meta_key = QTS_META_PREFIX . $this->get_temp_lang();
$post_type_sql = $post_type;
Expand Down