From 83253f757f4334c92ace95b64c463068051a706d Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 14 Oct 2004 08:09:00 +0000 Subject: [PATCH] Fix for bug 299. git-svn-id: http://svn.automattic.com/wordpress/trunk@1798 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/options-permalink.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 9a146ba9a..4e30ae5b2 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -20,17 +20,25 @@ if ( $home != '' && $home != get_settings('siteurl') ) { $home_path = ABSPATH; } -if (isset($_POST['submit'])) { - $permalink_structure = preg_replace('#/+/#', '/', $_POST['permalink_structure']); +if ( isset($_POST) ) { + if ( $_POST['permalink_structure'] ) + $permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']); + else + $permalink_structure = $_POST['permalink_structure']; + + if ( $_POST['category_base'] ) + $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']); + else + $category_base = $_POST['category_base']; + update_option('permalink_structure', $permalink_structure); - - update_option('category_base', $_POST['category_base']); - $category_base = $_POST['category_base']; -} else { - $permalink_structure = get_settings('permalink_structure'); - $category_base = get_settings('category_base'); + update_option('category_base', $category_base); } +$permalink_structure = get_settings('permalink_structure'); +$category_base = get_settings('category_base'); + + generate_page_rewrite_rules(); if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )