Project

General

Profile

« Previous | Next » 

Revision 1356

Added by Dietmar almost 14 years ago

more little fixes in settings
change to RC2

View differences:

save.php
29 29
if($advanced == '')
30 30
{
31 31
	$admin = new admin('Settings', 'settings_basic');
32
	$_POST['database_password'] = DB_PASSWORD;
33 32
} else {
34 33
	$admin = new admin('Settings', 'settings_advanced');
35 34
}
......
155 154
	$old_settings[$setting['name']] = $setting['value'];
156 155
	$setting_name = $setting['name'];
157 156
	$value = $admin->get_post($setting_name);
157
	$value = isset($_POST[$setting_name]) ? $value : $old_settings[$setting_name] ;
158 158
	switch ($setting_name) {
159 159
		case 'default_timezone':
160 160
			$value=$value*60*60;
......
166 166
			$value=$file_mode;
167 167
			break;
168 168
		case 'pages_directory':
169
			if(trim($value)=='/') $value='';
170 169
			break;
171 170
		default :
172 171

  
......
179 178

  
180 179
    $passed = in_array($setting_name, $allow_empty_values);
181 180

  
182
    if ( !in_array($value, $disallow_in_fields) && ((trim($value) <> '') || $passed == true) )
181
    if ( !in_array($value, $disallow_in_fields) && (isset($_POST[$setting_name]) || $passed == true) )
183 182
    {
184 183
        $value = trim($admin->add_slashes($value));
185 184
        $sql = 'UPDATE `'.TABLE_PREFIX.'settings` ';
......
187 186
        $sql .= 'WHERE `name` <> \'wb_version\' ';
188 187
        $sql .= 'AND `name` = \''.$setting_name.'\' ';
189 188

  
190
        if ($database->query($sql))
189
        if (!$database->query($sql))
191 190
        {
191
			if($database->is_error()) {
192
				$admin->print_error($database->get_error, ADMIN_URL.'/settings/index.php'.$advanced);
193
			}
192 194
        }
193 195
	}
194 196
}

Also available in: Unified diff