get_page_by_path() tweak.

git-svn-id: https://develop.svn.wordpress.org/trunk@3523 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-02-13 07:04:14 +00:00
parent 953064226a
commit 03f0909476
1 changed files with 3 additions and 2 deletions

View File

@ -665,8 +665,9 @@ function set_page_path($page) {
function get_page_by_path($page_path) {
global $wpdb;
$page_path = str_replace('%2F', '/', urlencode(urldecode($page_path)));
$page_path = rawurlencode(urldecode($page_path));
$page_path = str_replace('%2F', '/', $page_path);
$page_path = str_replace('%20', ' ', $page_path);
$page_paths = '/' . trim($page_path, '/');
$leaf_path = sanitize_title(basename($page_paths));
$page_paths = explode('/', $page_paths);