Skip to content

Commit 5331654

Browse files
committed
Fix for bug 299.
git-svn-id: https://develop.svn.wordpress.org/trunk@1798 602fd350-edb4-49c9-b593-d223f7449a82
1 parent db93072 commit 5331654

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

wp-admin/options-permalink.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,25 @@
2020
$home_path = ABSPATH;
2121
}
2222

23-
if (isset($_POST['submit'])) {
24-
$permalink_structure = preg_replace('#/+/#', '/', $_POST['permalink_structure']);
23+
if ( isset($_POST) ) {
24+
if ( $_POST['permalink_structure'] )
25+
$permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
26+
else
27+
$permalink_structure = $_POST['permalink_structure'];
28+
29+
if ( $_POST['category_base'] )
30+
$category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
31+
else
32+
$category_base = $_POST['category_base'];
33+
2534
update_option('permalink_structure', $permalink_structure);
26-
27-
update_option('category_base', $_POST['category_base']);
28-
$category_base = $_POST['category_base'];
29-
} else {
30-
$permalink_structure = get_settings('permalink_structure');
31-
$category_base = get_settings('category_base');
35+
update_option('category_base', $category_base);
3236
}
3337

38+
$permalink_structure = get_settings('permalink_structure');
39+
$category_base = get_settings('category_base');
40+
41+
3442
generate_page_rewrite_rules();
3543

3644
if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )

0 commit comments

Comments
 (0)