function advanced_prefs_save() { // update custom fields count from database schema and cache it as a hidden pref $max_custom_fields = count(preg_grep('/^custom_\\d+/', getThings('describe `' . PFX . 'textpattern`'))); set_pref('max_custom_fields', $max_custom_fields, 'publish', 2); // safe all regular advanced prefs $prefnames = safe_column("name", "txp_prefs", "prefs_id = 1 AND type = 1"); $post = doSlash(stripPost()); if (empty($post['tempdir'])) { $post['tempdir'] = doSlash(find_temp_dir()); } if (!empty($post['file_max_upload_size'])) { $post['file_max_upload_size'] = real_max_upload_size($post['file_max_upload_size']); } foreach ($prefnames as $prefname) { if (isset($post[$prefname])) { safe_update("txp_prefs", "val = '" . $post[$prefname] . "'", "name = '" . doSlash($prefname) . "' and prefs_id = 1"); } } update_lastmod(); advanced_prefs(gTxt('preferences_saved')); }
function advanced_prefs_save() { $prefnames = safe_column("name", "txp_prefs", "prefs_id = 1 AND type = 1"); $post = doSlash(stripPost()); if (empty($post['tempdir'])) { $post['tempdir'] = doSlash(find_temp_dir()); } if (!empty($post['file_max_upload_size'])) { $post['file_max_upload_size'] = real_max_upload_size($post['file_max_upload_size']); } foreach ($prefnames as $prefname) { if (isset($post[$prefname])) { safe_update("txp_prefs", "val = '" . $post[$prefname] . "'", "name = '" . doSlash($prefname) . "' and prefs_id = 1"); } } update_lastmod(); advanced_prefs(gTxt('preferences_saved')); }
function advanced_prefs_save() { $prefnames = safe_column("name", "txp_prefs", "prefs_id='1' AND type='1'"); $post = doSlash(stripPost()); if (!empty($post['file_max_upload_size'])) { $post['file_max_upload_size'] = real_max_upload_size($post['file_max_upload_size']); } foreach ($prefnames as $prefname) { if (isset($post[$prefname])) { safe_update("txp_prefs", "val = '" . $post[$prefname] . "'", "name = '{$prefname}' and prefs_id ='1'"); } } advanced_prefs(gTxt('preferences_saved')); }