Make WordPress Core


Ignore:
Timestamp:
10/18/2004 04:50:08 AM (20 years ago)
Author:
rboren
Message:

Do not stomp permalink setting. Bug 372.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r1798 r1810  
    77require_once('./admin-header.php');
    88if ($user_level <= 8)
    9     die(__('You have do not have sufficient permissions to edit the options for this blog.'));
     9    die(__('You have do not have sufficient permissions to edit the options
     10for this blog.'));
    1011
    1112require('./options-head.php');
     
    2223
    2324if ( isset($_POST) ) {
    24     if ( $_POST['permalink_structure'] )
    25         $permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
    26     else
     25    if ( isset($_POST['permalink_structure']) ) {
    2726        $permalink_structure = $_POST['permalink_structure'];
     27        if (! empty($permalink_structure) )
     28            $permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
     29        update_option('permalink_structure', $permalink_structure);
     30    }
    2831   
    29     if ( $_POST['category_base'] )
    30         $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
    31     else
     32    if ( isset($_POST['category_base']) ) {
    3233        $category_base = $_POST['category_base'];
     34        if (! empty($category_base) )
     35            $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
     36        update_option('category_base', $category_base);
     37    }
     38}
    3339   
    34     update_option('permalink_structure', $permalink_structure);
    35     update_option('category_base', $category_base);
    36 }
    37 
    3840$permalink_structure = get_settings('permalink_structure');
    3941$category_base = get_settings('category_base');
Note: See TracChangeset for help on using the changeset viewer.