Make WordPress Core


Ignore:
Timestamp:
04/28/2004 08:31:41 PM (22 years ago)
Author:
saxmatt
Message:

Gremlins in the options machine.

File:
1 edited

Legend:

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

    r1198 r1206  
    3636        }
    3737}
    38 $option_group_id = (int) $_GET['option_group_id'];
     38if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id'];
    3939require_once('./optionhandler.php');
    4040$non_was_selected = 0;
     
    8484                                if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
    8585                if ($new_val !== $old_val) {
    86                                         $query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id";
     86                                        $query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_name = '$option->option_name'";
    8787                                        $result = $wpdb->query($query);
    8888                                        //if( in_array($option->option_name, $nonbools)) die('boo'.$query);
     
    110110    }
    111111
    112         $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
     112         if (strstr($_SERVER['HTTP_REFERER'], '?')) $goback = str_replace('&updated=true', '', $_SERVER['HTTP_REFERER']) . '&updated=true';
     113        else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
    113114    header('Location: ' . $goback);
    114115    break;
Note: See TracChangeset for help on using the changeset viewer.