[wp-trac] [WordPress Trac] #10249: Page slug in cyrillic = Error 404 - Not Found!
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 2 17:12:21 UTC 2011
#10249: Page slug in cyrillic = Error 404 - Not Found!
------------------------------------+-----------------------
Reporter: kalifi | Owner: westi
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 3.3
Component: Permalinks | Version: 2.7
Severity: major | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+-----------------------
Changes (by SergeyBiryukov):
* keywords: has-patch 2nd-opinion => has-patch dev-feedback
* milestone: Future Release => 3.3
Comment:
[18541] indeed broke `get_page_by_path()` for non-English slugs.
This is what Debug Bar shows:
{{{
WARNING: wp-includes/wp-db.php:890 - vsprintf() [function.vsprintf]: Too
few arguments
}}}
SQL query is:
{{{
SELECT ID, post_name, post_parent FROM trunk_posts WHERE post_name IN
('%d0%ba%d0%b8%d1%80%d0%be') AND (post_type = '%s' OR post_type =
'attachment') AND trunk_posts.post_type IN ('post', 'page', 'attachment')
}}}
`vsprintf()` in `$wpdb->prepare()` thinks those encoded chars are
placeholders.
Before [18541], only a single page slug was queried here, and it was
escaped properly.
[attachment:10249.1.patch] fixes the issue by escaping `%` chars before
passing `$in_string` to `$wpdb->prepare()`.
[attachment:10249.2.patch] escapes `$post_type`, which makes
`$wpdb->prepare()` unnecessary, since queried post slugs are also escaped
earlier.
Both patches also contain the refreshed [attachment:page-slugs-urldecode-
other-way-round.diff].
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10249#comment:42>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list