get_page_by_path() tweak.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-02-13 07:04:14 +00:00
parent 373424383e
commit a9fca43a85
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);