Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.135
diff -u -r1.135 file.inc
--- includes/file.inc	20 Sep 2008 03:49:23 -0000	1.135
+++ includes/file.inc	29 Sep 2008 22:13:56 -0000
@@ -96,7 +96,7 @@
   if (strpos($path, file_directory_path() . '/') === 0) {
     $path = trim(substr($path, strlen(file_directory_path())), '\\/');
   }
-  switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
+  switch (variable_get('file_downloads')) {
     case FILE_DOWNLOADS_PUBLIC:
       return $GLOBALS['base_url'] . '/' . file_directory_path() . '/' . str_replace('\\', '/', $path);
     case FILE_DOWNLOADS_PRIVATE:
@@ -399,7 +399,7 @@
   $original = $filename;
 
   // Allow potentially insecure uploads for very savvy users and admin
-  if (!variable_get('allow_insecure_uploads', 0)) {
+  if (!variable_get('allow_insecure_uploads')) {
     $whitelist = array_unique(explode(' ', trim($extensions)));
 
     // Split the filename up by periods. The first part becomes the basename
@@ -587,7 +587,7 @@
     $extensions = '';
     foreach ($user->roles as $rid => $name) {
       $extensions .= ' ' . variable_get("upload_extensions_$rid",
-      variable_get('upload_extensions_default', 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp'));
+      variable_get('upload_extensions_default'));
     }
 
     // Begin building file object.
@@ -1026,7 +1026,7 @@
  * @return A string containing a temp directory.
  */
 function file_directory_temp() {
-  $temporary_directory = variable_get('file_directory_temp', NULL);
+  $temporary_directory = variable_get('file_directory_temp');
 
   if (is_null($temporary_directory)) {
     $directories = array();
@@ -1065,7 +1065,7 @@
  * @return A string containing the path to Drupal's 'files' directory.
  */
 function file_directory_path() {
-  return variable_get('file_directory_path', conf_path() . '/files');
+  return variable_get('file_directory_path');
 }
 
 /**
@@ -1100,354 +1100,7 @@
  */
 function file_get_mimetype($filename, $mapping = NULL) {
   if (!is_array($mapping)) {
-    $mapping = variable_get('mime_extension_mapping', array(
-      'ez' => 'application/andrew-inset',
-      'atom' => 'application/atom',
-      'atomcat' => 'application/atomcat+xml',
-      'atomsrv' => 'application/atomserv+xml',
-      'cap|pcap' => 'application/cap',
-      'cu' => 'application/cu-seeme',
-      'tsp' => 'application/dsptype',
-      'spl' => 'application/x-futuresplash',
-      'hta' => 'application/hta',
-      'jar' => 'application/java-archive',
-      'ser' => 'application/java-serialized-object',
-      'class' => 'application/java-vm',
-      'hqx' => 'application/mac-binhex40',
-      'cpt' => 'image/x-corelphotopaint',
-      'nb' => 'application/mathematica',
-      'mdb' => 'application/msaccess',
-      'doc|dot' => 'application/msword',
-      'bin' => 'application/octet-stream',
-      'oda' => 'application/oda',
-      'ogg|ogx' => 'application/ogg',
-      'pdf' => 'application/pdf',
-      'key' => 'application/pgp-keys',
-      'pgp' => 'application/pgp-signature',
-      'prf' => 'application/pics-rules',
-      'ps|ai|eps' => 'application/postscript',
-      'rar' => 'application/rar',
-      'rdf' => 'application/rdf+xml',
-      'rss' => 'application/rss+xml',
-      'rtf' => 'application/rtf',
-      'smi|smil' => 'application/smil',
-      'wpd' => 'application/wordperfect',
-      'wp5' => 'application/wordperfect5.1',
-      'xhtml|xht' => 'application/xhtml+xml',
-      'xml|xsl' => 'application/xml',
-      'zip' => 'application/zip',
-      'cdy' => 'application/vnd.cinderella',
-      'kml' => 'application/vnd.google-earth.kml+xml',
-      'kmz' => 'application/vnd.google-earth.kmz',
-      'xul' => 'application/vnd.mozilla.xul+xml',
-      'xls|xlb|xlt' => 'application/vnd.ms-excel',
-      'cat' => 'application/vnd.ms-pki.seccat',
-      'stl' => 'application/vnd.ms-pki.stl',
-      'ppt|pps' => 'application/vnd.ms-powerpoint',
-      'odc' => 'application/vnd.oasis.opendocument.chart',
-      'odb' => 'application/vnd.oasis.opendocument.database',
-      'odf' => 'application/vnd.oasis.opendocument.formula',
-      'odg' => 'application/vnd.oasis.opendocument.graphics',
-      'otg' => 'application/vnd.oasis.opendocument.graphics-template',
-      'odi' => 'application/vnd.oasis.opendocument.image',
-      'odp' => 'application/vnd.oasis.opendocument.presentation',
-      'otp' => 'application/vnd.oasis.opendocument.presentation-template',
-      'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
-      'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
-      'odt' => 'application/vnd.oasis.opendocument.text',
-      'odm' => 'application/vnd.oasis.opendocument.text-master',
-      'ott' => 'application/vnd.oasis.opendocument.text-template',
-      'oth' => 'application/vnd.oasis.opendocument.text-web',
-      'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
-      'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
-      'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
-      'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
-      'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
-      'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
-      'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
-      'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
-      'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
-      'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
-      'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
-      'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
-      'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
-      'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
-      'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
-      'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
-      'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
-      'cod' => 'application/vnd.rim.cod',
-      'mmf' => 'application/vnd.smaf',
-      'sdc' => 'application/vnd.stardivision.calc',
-      'sds' => 'application/vnd.stardivision.chart',
-      'sda' => 'application/vnd.stardivision.draw',
-      'sdd' => 'application/vnd.stardivision.impress',
-      'sdf' => 'application/vnd.stardivision.math',
-      'sdw' => 'application/vnd.stardivision.writer',
-      'sgl' => 'application/vnd.stardivision.writer-global',
-      'sxc' => 'application/vnd.sun.xml.calc',
-      'stc' => 'application/vnd.sun.xml.calc.template',
-      'sxd' => 'application/vnd.sun.xml.draw',
-      'std' => 'application/vnd.sun.xml.draw.template',
-      'sxi' => 'application/vnd.sun.xml.impress',
-      'sti' => 'application/vnd.sun.xml.impress.template',
-      'sxm' => 'application/vnd.sun.xml.math',
-      'sxw' => 'application/vnd.sun.xml.writer',
-      'sxg' => 'application/vnd.sun.xml.writer.global',
-      'stw' => 'application/vnd.sun.xml.writer.template',
-      'sis' => 'application/vnd.symbian.install',
-      'vsd' => 'application/vnd.visio',
-      'wbxml' => 'application/vnd.wap.wbxml',
-      'wmlc' => 'application/vnd.wap.wmlc',
-      'wmlsc' => 'application/vnd.wap.wmlscriptc',
-      'wk' => 'application/x-123',
-      '7z' => 'application/x-7z-compressed',
-      'abw' => 'application/x-abiword',
-      'dmg' => 'application/x-apple-diskimage',
-      'bcpio' => 'application/x-bcpio',
-      'torrent' => 'application/x-bittorrent',
-      'cab' => 'application/x-cab',
-      'cbr' => 'application/x-cbr',
-      'cbz' => 'application/x-cbz',
-      'cdf' => 'application/x-cdf',
-      'vcd' => 'application/x-cdlink',
-      'pgn' => 'application/x-chess-pgn',
-      'cpio' => 'application/x-cpio',
-      'csh' => 'text/x-csh',
-      'deb|udeb' => 'application/x-debian-package',
-      'dcr|dir|dxr' => 'application/x-director',
-      'dms' => 'application/x-dms',
-      'wad' => 'application/x-doom',
-      'dvi' => 'application/x-dvi',
-      'rhtml' => 'application/x-httpd-eruby',
-      'flac' => 'application/x-flac',
-      'pfa|pfb|gsf|pcf|pcf.Z' => 'application/x-font',
-      'mm' => 'application/x-freemind',
-      'gnumeric' => 'application/x-gnumeric',
-      'sgf' => 'application/x-go-sgf',
-      'gcf' => 'application/x-graphing-calculator',
-      'gtar|tgz|taz' => 'application/x-gtar',
-      'hdf' => 'application/x-hdf',
-      'phtml|pht|php' => 'application/x-httpd-php',
-      'phps' => 'application/x-httpd-php-source',
-      'php3' => 'application/x-httpd-php3',
-      'php3p' => 'application/x-httpd-php3-preprocessed',
-      'php4' => 'application/x-httpd-php4',
-      'ica' => 'application/x-ica',
-      'ins|isp' => 'application/x-internet-signup',
-      'iii' => 'application/x-iphone',
-      'iso' => 'application/x-iso9660-image',
-      'jnlp' => 'application/x-java-jnlp-file',
-      'js' => 'application/x-javascript',
-      'jmz' => 'application/x-jmol',
-      'chrt' => 'application/x-kchart',
-      'kil' => 'application/x-killustrator',
-      'skp|skd|skt|skm' => 'application/x-koan',
-      'kpr|kpt' => 'application/x-kpresenter',
-      'ksp' => 'application/x-kspread',
-      'kwd|kwt' => 'application/x-kword',
-      'latex' => 'application/x-latex',
-      'lha' => 'application/x-lha',
-      'lyx' => 'application/x-lyx',
-      'lzh' => 'application/x-lzh',
-      'lzx' => 'application/x-lzx',
-      'frm|maker|frame|fm|fb|book|fbdoc' => 'application/x-maker',
-      'mif' => 'application/x-mif',
-      'wmd' => 'application/x-ms-wmd',
-      'wmz' => 'application/x-ms-wmz',
-      'com|exe|bat|dll' => 'application/x-msdos-program',
-      'msi' => 'application/x-msi',
-      'nc' => 'application/x-netcdf',
-      'pac' => 'application/x-ns-proxy-autoconfig',
-      'nwc' => 'application/x-nwc',
-      'o' => 'application/x-object',
-      'oza' => 'application/x-oz-application',
-      'p7r' => 'application/x-pkcs7-certreqresp',
-      'crl' => 'application/x-pkcs7-crl',
-      'pyc|pyo' => 'application/x-python-code',
-      'qtl' => 'application/x-quicktimeplayer',
-      'rpm' => 'application/x-redhat-package-manager',
-      'sh' => 'text/x-sh',
-      'shar' => 'application/x-shar',
-      'swf|swfl' => 'application/x-shockwave-flash',
-      'sit|sitx' => 'application/x-stuffit',
-      'sv4cpio' => 'application/x-sv4cpio',
-      'sv4crc' => 'application/x-sv4crc',
-      'tar' => 'application/x-tar',
-      'tcl' => 'application/x-tcl',
-      'gf' => 'application/x-tex-gf',
-      'pk' => 'application/x-tex-pk',
-      'texinfo|texi' => 'application/x-texinfo',
-      '~|%|bak|old|sik' => 'application/x-trash',
-      't|tr|roff' => 'application/x-troff',
-      'man' => 'application/x-troff-man',
-      'me' => 'application/x-troff-me',
-      'ms' => 'application/x-troff-ms',
-      'ustar' => 'application/x-ustar',
-      'src' => 'application/x-wais-source',
-      'wz' => 'application/x-wingz',
-      'crt' => 'application/x-x509-ca-cert',
-      'xcf' => 'application/x-xcf',
-      'fig' => 'application/x-xfig',
-      'xpi' => 'application/x-xpinstall',
-      'au|snd' => 'audio/basic',
-      'mid|midi|kar' => 'audio/midi',
-      'mpga|mpega|mp2|mp3|m4a' => 'audio/mpeg',
-      'm3u' => 'audio/x-mpegurl',
-      'oga|spx' => 'audio/ogg',
-      'sid' => 'audio/prs.sid',
-      'aif|aiff|aifc' => 'audio/x-aiff',
-      'gsm' => 'audio/x-gsm',
-      'wma' => 'audio/x-ms-wma',
-      'wax' => 'audio/x-ms-wax',
-      'ra|rm|ram' => 'audio/x-pn-realaudio',
-      'ra' => 'audio/x-realaudio',
-      'pls' => 'audio/x-scpls',
-      'sd2' => 'audio/x-sd2',
-      'wav' => 'audio/x-wav',
-      'alc' => 'chemical/x-alchemy',
-      'cac|cache' => 'chemical/x-cache',
-      'csf' => 'chemical/x-cache-csf',
-      'cbin|cascii|ctab' => 'chemical/x-cactvs-binary',
-      'cdx' => 'chemical/x-cdx',
-      'cer' => 'chemical/x-cerius',
-      'c3d' => 'chemical/x-chem3d',
-      'chm' => 'chemical/x-chemdraw',
-      'cif' => 'chemical/x-cif',
-      'cmdf' => 'chemical/x-cmdf',
-      'cml' => 'chemical/x-cml',
-      'cpa' => 'chemical/x-compass',
-      'bsd' => 'chemical/x-crossfire',
-      'csml|csm' => 'chemical/x-csml',
-      'ctx' => 'chemical/x-ctx',
-      'cxf|cef' => 'chemical/x-cxf',
-      'emb|embl' => 'chemical/x-embl-dl-nucleotide',
-      'spc' => 'chemical/x-galactic-spc',
-      'inp|gam|gamin' => 'chemical/x-gamess-input',
-      'fch|fchk' => 'chemical/x-gaussian-checkpoint',
-      'cub' => 'chemical/x-gaussian-cube',
-      'gau|gjc|gjf' => 'chemical/x-gaussian-input',
-      'gal' => 'chemical/x-gaussian-log',
-      'gcg' => 'chemical/x-gcg8-sequence',
-      'gen' => 'chemical/x-genbank',
-      'hin' => 'chemical/x-hin',
-      'istr|ist' => 'chemical/x-isostar',
-      'jdx|dx' => 'chemical/x-jcamp-dx',
-      'kin' => 'chemical/x-kinemage',
-      'mcm' => 'chemical/x-macmolecule',
-      'mmd|mmod' => 'chemical/x-macromodel-input',
-      'mol' => 'chemical/x-mdl-molfile',
-      'rd' => 'chemical/x-mdl-rdfile',
-      'rxn' => 'chemical/x-mdl-rxnfile',
-      'sd|sdf' => 'chemical/x-mdl-sdfile',
-      'tgf' => 'chemical/x-mdl-tgf',
-      'mcif' => 'chemical/x-mmcif',
-      'mol2' => 'chemical/x-mol2',
-      'b' => 'chemical/x-molconn-Z',
-      'gpt' => 'chemical/x-mopac-graph',
-      'mop|mopcrt|mpc|dat|zmt' => 'chemical/x-mopac-input',
-      'moo' => 'chemical/x-mopac-out',
-      'mvb' => 'chemical/x-mopac-vib',
-      'asn' => 'chemical/x-ncbi-asn1-spec',
-      'prt|ent' => 'chemical/x-ncbi-asn1-ascii',
-      'val|aso' => 'chemical/x-ncbi-asn1-binary',
-      'pdb|ent' => 'chemical/x-pdb',
-      'ros' => 'chemical/x-rosdal',
-      'sw' => 'chemical/x-swissprot',
-      'vms' => 'chemical/x-vamas-iso14976',
-      'vmd' => 'chemical/x-vmd',
-      'xtel' => 'chemical/x-xtel',
-      'xyz' => 'chemical/x-xyz',
-      'gif' => 'image/gif',
-      'ief' => 'image/ief',
-      'jpeg|jpg|jpe' => 'image/jpeg',
-      'pcx' => 'image/pcx',
-      'png' => 'image/png',
-      'svg|svgz' => 'image/svg+xml',
-      'tiff|tif' => 'image/tiff',
-      'djvu|djv' => 'image/vnd.djvu',
-      'wbmp' => 'image/vnd.wap.wbmp',
-      'ras' => 'image/x-cmu-raster',
-      'cdr' => 'image/x-coreldraw',
-      'pat' => 'image/x-coreldrawpattern',
-      'cdt' => 'image/x-coreldrawtemplate',
-      'ico' => 'image/x-icon',
-      'art' => 'image/x-jg',
-      'jng' => 'image/x-jng',
-      'bmp' => 'image/x-ms-bmp',
-      'psd' => 'image/x-photoshop',
-      'pnm' => 'image/x-portable-anymap',
-      'pbm' => 'image/x-portable-bitmap',
-      'pgm' => 'image/x-portable-graymap',
-      'ppm' => 'image/x-portable-pixmap',
-      'rgb' => 'image/x-rgb',
-      'xbm' => 'image/x-xbitmap',
-      'xpm' => 'image/x-xpixmap',
-      'xwd' => 'image/x-xwindowdump',
-      'eml' => 'message/rfc822',
-      'igs|iges' => 'model/iges',
-      'msh|mesh|silo' => 'model/mesh',
-      'wrl|vrml' => 'model/vrml',
-      'ics|icz' => 'text/calendar',
-      'css' => 'text/css',
-      'csv' => 'text/csv',
-      '323' => 'text/h323',
-      'html|htm|shtml' => 'text/html',
-      'uls' => 'text/iuls',
-      'mml' => 'text/mathml',
-      'asc|txt|text|pot' => 'text/plain',
-      'rtx' => 'text/richtext',
-      'sct|wsc' => 'text/scriptlet',
-      'tm|ts' => 'text/texmacs',
-      'tsv' => 'text/tab-separated-values',
-      'jad' => 'text/vnd.sun.j2me.app-descriptor',
-      'wml' => 'text/vnd.wap.wml',
-      'wmls' => 'text/vnd.wap.wmlscript',
-      'bib' => 'text/x-bibtex',
-      'boo' => 'text/x-boo',
-      'h++|hpp|hxx|hh' => 'text/x-c++hdr',
-      'c++|cpp|cxx|cc' => 'text/x-c++src',
-      'h' => 'text/x-chdr',
-      'htc' => 'text/x-component',
-      'c' => 'text/x-csrc',
-      'd' => 'text/x-dsrc',
-      'diff|patch' => 'text/x-diff',
-      'hs' => 'text/x-haskell',
-      'java' => 'text/x-java',
-      'lhs' => 'text/x-literate-haskell',
-      'moc' => 'text/x-moc',
-      'p|pas' => 'text/x-pascal',
-      'gcd' => 'text/x-pcs-gcd',
-      'pl|pm' => 'text/x-perl',
-      'py' => 'text/x-python',
-      'etx' => 'text/x-setext',
-      'tcl|tk' => 'text/x-tcl',
-      'tex|ltx|sty|cls' => 'text/x-tex',
-      'vcs' => 'text/x-vcalendar',
-      'vcf' => 'text/x-vcard',
-      '3gp' => 'video/3gpp',
-      'dl' => 'video/dl',
-      'dif|dv' => 'video/dv',
-      'fli' => 'video/fli',
-      'gl' => 'video/gl',
-      'mpeg|mpg|mpe' => 'video/mpeg',
-      'mp4' => 'video/mp4',
-      'ogv' => 'video/ogg',
-      'qt|mov' => 'video/quicktime',
-      'mxu' => 'video/vnd.mpegurl',
-      'lsf|lsx' => 'video/x-la-asf',
-      'mng' => 'video/x-mng',
-      'asf|asx' => 'video/x-ms-asf',
-      'wm' => 'video/x-ms-wm',
-      'wmv' => 'video/x-ms-wmv',
-      'wmx' => 'video/x-ms-wmx',
-      'wvx' => 'video/x-ms-wvx',
-      'avi' => 'video/x-msvideo',
-      'movie' => 'video/x-sgi-movie',
-      'ice' => 'x-conference/x-cooltalk',
-      'sisx' => 'x-epoc/x-sisx-app',
-      'vrm|vrml|wrl' => 'x-world/x-vrml',
-      'xps' => 'application/vnd.ms-xpsdocument',
-    ));
+    $mapping = variable_get('mime_extension_mapping');
   }
   foreach ($mapping as $ext_preg => $mime_match) {
     if (preg_match('!\.('. $ext_preg .')$!i', $filename)) {
Index: includes/mail.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/mail.inc,v
retrieving revision 1.15
diff -u -r1.15 mail.inc
--- includes/mail.inc	20 Sep 2008 20:22:23 -0000	1.15
+++ includes/mail.inc	29 Sep 2008 22:13:56 -0000
@@ -81,7 +81,7 @@
  *   accepted at php-level, which still doesn't guarantee it to be delivered.)
  */
 function drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE) {
-  $default_from = variable_get('site_mail', ini_get('sendmail_from'));
+  $default_from = variable_get('site_mail');
 
   // Bundle up the variables into a structured array for altering.
   $message = array(
@@ -172,8 +172,8 @@
  */
 function drupal_mail_send($message) {
   // Allow for a custom mail backend.
-  if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) {
-    include_once DRUPAL_ROOT . '/' . variable_get('smtp_library', '');
+  if (variable_get('smtp_library') && file_exists(variable_get('smtp_library'))) {
+    include_once DRUPAL_ROOT . '/' . variable_get('smtp_library');
     return drupal_mail_wrapper($message);
   }
   else {
Index: includes/language.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/language.inc,v
retrieving revision 1.16
diff -u -r1.16 language.inc
--- includes/language.inc	14 Apr 2008 17:48:33 -0000	1.16
+++ includes/language.inc	29 Sep 2008 22:13:56 -0000
@@ -13,7 +13,7 @@
   global $user;
 
   // Configured presentation language mode.
-  $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
+  $mode = variable_get('language_negotiation');
   // Get a list of enabled languages.
   $languages = language_list('enabled');
   $languages = $languages[1];
@@ -113,7 +113,7 @@
       $options['language'] = $language;
     }
 
-    switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
+    switch (variable_get('language_negotiation')) {
       case LANGUAGE_NEGOTIATION_NONE:
         // No language dependent path allowed in this mode.
         unset($options['language']);
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.60
diff -u -r1.60 session.inc
--- includes/session.inc	27 Sep 2008 20:37:00 -0000	1.60
+++ includes/session.inc	29 Sep 2008 22:13:56 -0000
@@ -154,7 +154,7 @@
       // Last access time is updated no more frequently
       // than once every 180 seconds.
       // This reduces contention in the users table.
-      if ($user->uid && REQUEST_TIME - $user->access > variable_get('session_write_interval', 180)) {
+      if ($user->uid && REQUEST_TIME - $user->access > variable_get('session_write_interval')) {
         db_query("UPDATE {users} SET access = %d WHERE uid = %d", REQUEST_TIME, $user->uid);
       }
     }
Index: includes/cache.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/cache.inc,v
retrieving revision 1.24
diff -u -r1.24 cache.inc
--- includes/cache.inc	17 Sep 2008 07:11:55 -0000	1.24
+++ includes/cache.inc	29 Sep 2008 22:13:55 -0000
@@ -18,8 +18,8 @@
   global $user;
 
   // Garbage collection necessary when enforcing a minimum cache lifetime
-  $cache_flush = variable_get('cache_flush', 0);
-  if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME)) {
+  $cache_flush = variable_get('cache_flush');
+  if ($cache_flush && ($cache_flush + variable_get('cache_lifetime') <= REQUEST_TIME)) {
     // Reset the variable immediately to prevent a meltdown in heavy load situations.
     variable_set('cache_flush', 0);
     // Time to flush old cache data
@@ -30,7 +30,7 @@
   if (isset($cache->data)) {
     // If the data is permanent or we're not enforcing a minimum cache lifetime
     // always return the cached data.
-    if ($cache->expire == CACHE_PERMANENT || !variable_get('cache_lifetime', 0)) {
+    if ($cache->expire == CACHE_PERMANENT || !variable_get('cache_lifetime')) {
       if ($cache->serialized) {
         $cache->data = unserialize($cache->data);
       }
@@ -150,19 +150,19 @@
   }
 
   if (empty($cid)) {
-    if (variable_get('cache_lifetime', 0)) {
+    if (variable_get('cache_lifetime')) {
       // We store the time in the current user's $user->cache variable which
       // will be saved into the sessions table by _sess_write(). We then
       // simulate that the cache was flushed for this user by not returning
       // cached data that was cached before the timestamp.
       $user->cache = REQUEST_TIME;
 
-      $cache_flush = variable_get('cache_flush', 0);
+      $cache_flush = variable_get('cache_flush');
       if ($cache_flush == 0) {
         // This is the first request to clear the cache, start a timer.
         variable_set('cache_flush', REQUEST_TIME);
       }
-      else if (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) {
+      else if (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime'))) {
         // Clear the cache for everyone, cache_flush_delay seconds have
         // passed since the first request to clear the cache.
         db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, REQUEST_TIME);
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.292
diff -u -r1.292 menu.inc
--- includes/menu.inc	22 Sep 2008 03:19:43 -0000	1.292
+++ includes/menu.inc	29 Sep 2008 22:13:56 -0000
@@ -256,7 +256,7 @@
   $ancestors = array();
   $length =  $number_parts - 1;
   $end = (1 << $number_parts) - 1;
-  $masks = variable_get('menu_masks', array());
+  $masks = variable_get('menu_masks');
   // Only examine patterns that actually exist as router items (the masks).
   foreach ($masks as $i) {
     if ($i > $end) {
@@ -387,7 +387,7 @@
   if (_menu_site_is_offline()) {
     return MENU_SITE_OFFLINE;
   }
-  if (variable_get('menu_rebuild_needed', FALSE)) {
+  if (variable_get('menu_rebuild_needed')) {
     menu_rebuild();
   }
   if ($router_item = menu_get_item($path)) {
@@ -950,7 +950,7 @@
           // Use array_values() so that the indices are numeric for array_merge().
           $args = $parents = array_unique(array_values($parents));
           $placeholders = implode(', ', array_fill(0, count($args), '%d'));
-          $expanded = variable_get('menu_expanded', array());
+          $expanded = variable_get('menu_expanded');
           // Check whether the current menu has any links set to be expanded.
           if (in_array($menu_name, $expanded)) {
             // Collect all the links set to be expanded, and then add all of
@@ -1262,7 +1262,7 @@
  * Return an array of links to be rendered as the Main menu.
  */
 function menu_main_menu() {
-  return menu_navigation_links(variable_get('menu_main_links_source', 'main-menu'));
+  return menu_navigation_links(variable_get('menu_main_links_source'));
 }
 
 /**
@@ -1272,11 +1272,11 @@
 
   // If the secondary menu source is set as the primary menu, we display the
   // second level of the primary menu.
-  if (variable_get('menu_secondary_links_source', 'secondary-menu') == variable_get('menu_main_links_source', 'main-menu')) {
-    return menu_navigation_links(variable_get('menu_main_links_source', 'main-menu'), 1);
+  if (variable_get('menu_secondary_links_source') == variable_get('menu_main_links_source')) {
+    return menu_navigation_links(variable_get('menu_main_links_source'), 1);
   }
   else {
-    return menu_navigation_links(variable_get('menu_secondary_links_source', 'secondary-menu'), 0);
+    return menu_navigation_links(variable_get('menu_secondary_links_source'), 0);
   }
 }
 
@@ -2457,7 +2457,7 @@
  */
 function _menu_site_is_offline() {
   // Check if site is set to offline mode.
-  if (variable_get('site_offline', 0)) {
+  if (variable_get('site_offline')) {
     // Check if the user has administration privileges.
     if (user_access('administer site configuration')) {
       // Ensure that the offline message is displayed only once [allowing for
Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.18
diff -u -r1.18 theme.maintenance.inc
--- includes/theme.maintenance.inc	20 Sep 2008 20:22:23 -0000	1.18
+++ includes/theme.maintenance.inc	29 Sep 2008 22:13:56 -0000
@@ -43,7 +43,7 @@
     drupal_load('module', 'system');
     drupal_load('module', 'filter');
 
-    $theme = variable_get('maintenance_theme', 'minnelli');
+    $theme = variable_get('maintenance_theme');
   }
 
   $themes = list_themes();
@@ -231,12 +231,12 @@
 
   // Construct page title
   if (drupal_get_title()) {
-    $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
+    $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name'));
   }
   else {
-    $head_title = array(variable_get('site_name', 'Drupal'));
-    if (variable_get('site_slogan', '')) {
-      $head_title[] = variable_get('site_slogan', '');
+    $head_title = array(variable_get('site_name'));
+    if (variable_get('site_slogan')) {
+      $head_title[] = variable_get('site_slogan');
     }
   }
   $variables['head_title']        = implode(' | ', $head_title);
@@ -244,7 +244,7 @@
   $variables['front_page']        = url();
   $variables['breadcrumb']        = '';
   $variables['feed_icons']        = '';
-  $variables['footer_message']    = filter_xss_admin(variable_get('site_footer', FALSE));
+  $variables['footer_message']    = filter_xss_admin(variable_get('site_footer'));
   $variables['head']              = drupal_get_html_head();
   $variables['help']              = '';
   $variables['language']          = $GLOBALS['language'];
@@ -255,8 +255,8 @@
   $variables['main_menu']         = array();
   $variables['secondary_menu']    = array();
   $variables['search_box']        = '';
-  $variables['site_name']         = (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : '');
-  $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : '');
+  $variables['site_name']         = (theme_get_setting('toggle_name') ? variable_get('site_name') : '');
+  $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? variable_get('site_slogan') : '');
   $variables['css']               = drupal_add_css();
   $variables['styles']            = drupal_get_css();
   $variables['scripts']           = drupal_get_js();
Index: includes/path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.24
diff -u -r1.24 path.inc
--- includes/path.inc	24 Jun 2008 22:12:15 -0000	1.24
+++ includes/path.inc	29 Sep 2008 22:13:56 -0000
@@ -18,7 +18,7 @@
     $_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/'));
   }
   else {
-    $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
+    $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage'));
   }
 }
 
@@ -218,7 +218,7 @@
 function drupal_is_front_page() {
   // As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path,
   // we can check it against the 'site_frontpage' variable.
-  return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'));
+  return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage'));
 }
 
 /**
@@ -236,7 +236,7 @@
   static $regexps;
 
   if (!isset($regexps[$patterns])) {
-    $regexps[$patterns] = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2'), preg_quote($patterns, '/')) . ')$/';
+    $regexps[$patterns] = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage'), '/') . '\2'), preg_quote($patterns, '/')) . ')$/';
   }
   return (bool)preg_match($regexps[$patterns], $path);
 }
Index: includes/actions.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/actions.inc,v
retrieving revision 1.18
diff -u -r1.18 actions.inc
--- includes/actions.inc	26 Sep 2008 16:13:37 -0000	1.18
+++ includes/actions.inc	29 Sep 2008 22:13:55 -0000
@@ -40,7 +40,7 @@
 function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL) {
   static $stack;
   $stack++;
-  if ($stack > variable_get('actions_max_stack', 35)) {
+  if ($stack > variable_get('actions_max_stack')) {
     watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), WATCHDOG_ERROR);
     return;
   }
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.799
diff -u -r1.799 common.inc
--- includes/common.inc	20 Sep 2008 20:22:23 -0000	1.799
+++ includes/common.inc	29 Sep 2008 22:13:56 -0000
@@ -329,8 +329,7 @@
   drupal_maintenance_theme();
   drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service unavailable');
   drupal_set_title(t('Site offline'));
-  print theme('maintenance_page', filter_xss_admin(variable_get('site_offline_message',
-    t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))));
+  print theme('maintenance_page', t(filter_xss_admin(variable_get('site_offline_message')), array('@site' => variable_get('site_name'))));
 }
 
 /**
@@ -346,7 +345,7 @@
     $_REQUEST['destination'] = $_GET['q'];
   }
 
-  $path = drupal_get_normal_path(variable_get('site_404', ''));
+  $path = drupal_get_normal_path(variable_get('site_404'));
   if ($path && $path != $_GET['q']) {
     // Set the active item in case there are tabs to display, or other
     // dependencies on the path.
@@ -375,7 +374,7 @@
     $_REQUEST['destination'] = $_GET['q'];
   }
 
-  $path = drupal_get_normal_path(variable_get('site_403', ''));
+  $path = drupal_get_normal_path(variable_get('site_403'));
   if ($path && $path != $_GET['q']) {
     // Set the active item in case there are tabs to display or other
     // dependencies on the path.
@@ -419,7 +418,7 @@
   // can't tie this call to any error because there is no surefire way to
   // tell whether a request has failed, so we add the check to places where
   // some parsing has failed.
-  if (!$self_test && variable_get('drupal_http_request_fails', FALSE)) {
+  if (!$self_test && variable_get('drupal_http_request_fails')) {
     $self_test = TRUE;
     $works = module_invoke('system', 'check_http_request');
     $self_test = FALSE;
@@ -621,7 +620,7 @@
     $entry = $types[$errno] . ': ' . $message . ' in ' . $filename . ' on line ' . $line . '.';
 
     // Force display of error messages in update.php.
-    if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {
+    if (variable_get('error_level') == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {
       drupal_set_message($entry, 'error');
     }
 
@@ -817,7 +816,7 @@
   // handful of string replacements. See settings.php for examples.
   // Cache the $custom_strings variable to improve performance.
   if (!isset($custom_strings[$langcode])) {
-    $custom_strings[$langcode] = variable_get('locale_custom_strings_' . $langcode, array());
+    $custom_strings[$langcode] = variable_get('locale_custom_strings_' . $langcode);
   }
   // Custom strings work for English too, even if locale module is disabled.
   if (isset($custom_strings[$langcode][$string])) {
@@ -1215,11 +1214,11 @@
 function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
   if (!isset($timezone)) {
     global $user;
-    if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+    if (variable_get('configurable_timezones') && $user->uid && strlen($user->timezone)) {
       $timezone = $user->timezone;
     }
     else {
-      $timezone = variable_get('date_default_timezone', 0);
+      $timezone = variable_get('date_default_timezone');
     }
   }
 
@@ -1227,17 +1226,17 @@
 
   switch ($type) {
     case 'small':
-      $format = variable_get('date_format_short', 'm/d/Y - H:i');
+      $format = variable_get('date_format_short');
       break;
     case 'large':
-      $format = variable_get('date_format_long', 'l, F j, Y - H:i');
+      $format = variable_get('date_format_long');
       break;
     case 'custom':
       // No change to format.
       break;
     case 'medium':
     default:
-      $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
+      $format = variable_get('date_format_medium');
   }
 
   $max = strlen($format);
@@ -1375,7 +1374,7 @@
 
   // Cache the clean_url variable to improve performance.
   if (!isset($clean_url)) {
-    $clean_url = (bool)variable_get('clean_url', '0');
+    $clean_url = (bool)variable_get('clean_url');
   }
 
   if (!isset($options['base_url'])) {
@@ -1525,7 +1524,7 @@
  */
 function drupal_page_footer() {
 
-  if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {
+  if (variable_get('cache') != CACHE_DISABLED) {
     page_set_cache();
   }
 
@@ -1750,15 +1749,15 @@
   $no_module_preprocess = '';
   $no_theme_preprocess = '';
 
-  $preprocess_css = (variable_get('preprocess_css', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
+  $preprocess_css = (variable_get('preprocess_css') && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
   $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads') == FILE_DOWNLOADS_PUBLIC);
 
   // A dummy query-string is added to filenames, to gain control over
   // browser-caching. The string changes on every update or full cache
   // flush, forcing browsers to load a new copy of the files, as the
   // URL changed.
-  $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
+  $query_string = '?' . substr(variable_get('css_js_query_string'), 0, 1);
 
   foreach ($css as $media => $types) {
     // If CSS preprocessing is off, we still need to output the styles.
@@ -2102,9 +2101,9 @@
   $preprocessed = '';
   $no_preprocess = array('core' => '', 'module' => '', 'theme' => '');
   $files = array();
-  $preprocess_js = (variable_get('preprocess_js', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
+  $preprocess_js = (variable_get('preprocess_js') && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
   $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads') == FILE_DOWNLOADS_PUBLIC);
 
   // A dummy query-string is added to filenames, to gain control over
   // browser-caching. The string changes on every update or full cache
@@ -2112,7 +2111,7 @@
   // URL changed. Files that should not be cached (see drupal_add_js())
   // get REQUEST_TIME as query-string instead, to enforce reload on every
   // page request.
-  $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
+  $query_string = '?' . substr(variable_get('css_js_query_string'), 0, 1);
 
   // For inline Javascript to validate as XHTML, all Javascript containing
   // XHTML needs to be wrapped in CDATA. To make that backwards compatible
@@ -2377,7 +2376,7 @@
  *   String to encode
  */
 function drupal_urlencode($text) {
-  if (variable_get('clean_url', '0')) {
+  if (variable_get('clean_url')) {
     return str_replace(array('%2F', '%26', '%23', '//'),
                        array('/', '%2526', '%2523', '/%252F'),
                        rawurlencode($text));
@@ -2432,7 +2431,7 @@
  *   The private key.
  */
 function drupal_get_private_key() {
-  if (!($key = variable_get('drupal_private_key', 0))) {
+  if (!($key = variable_get('drupal_private_key'))) {
     $key = md5(drupal_random_bytes(64));
     variable_set('drupal_private_key', $key);
   }
@@ -2465,7 +2464,7 @@
  */
 function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
   global $user;
-  return (($skip_anonymous && $user->uid == 0) || ($token == md5(session_id() . $value . variable_get('drupal_private_key', ''))));
+  return (($skip_anonymous && $user->uid == 0) || ($token == md5(session_id() . $value . variable_get('drupal_private_key'))));
 }
 
 /**
@@ -2553,7 +2552,7 @@
     // This will fail in some cases, see page_get_cache() for the explanation.
     if ($data = ob_get_contents()) {
       $cache = TRUE;
-      if (variable_get('page_compression', TRUE) && function_exists('gzencode')) {
+      if (variable_get('page_compression') && function_exists('gzencode')) {
         // We do not store the data in case the zlib mode is deflate.
         // This should be rarely happening.
         if (zlib_get_coding_type() == 'deflate') {
@@ -2586,7 +2585,7 @@
   @set_time_limit(240);
 
   // Fetch the cron semaphore
-  $semaphore = variable_get('cron_semaphore', FALSE);
+  $semaphore = variable_get('cron_semaphore');
 
   if ($semaphore) {
     if (REQUEST_TIME - $semaphore > 3600) {
@@ -2629,7 +2628,7 @@
  */
 function drupal_cron_cleanup() {
   // See if the semaphore is still locked.
-  if (variable_get('cron_semaphore', FALSE)) {
+  if (variable_get('cron_semaphore')) {
     watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);
 
     // Release cron semaphore
@@ -2674,7 +2673,7 @@
   // table contains the name of the current profile, and we can call variable_get()
   // to determine what one is active.
   if (!isset($profile)) {
-    $profile = variable_get('install_profile', 'default');
+    $profile = variable_get('install_profile');
   }
   $searchdir = array($directory);
   $files = array();
@@ -3590,7 +3589,7 @@
  * This is also called from update.php.
  */
 function _drupal_flush_css_js() {
-  $string_history = variable_get('css_js_query_string', '00000000000000000000');
+  $string_history = variable_get('css_js_query_string');
   $new_character = $string_history[0];
   $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
   while (strpos($string_history, $new_character) !== FALSE) {
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.228
diff -u -r1.228 bootstrap.inc
--- includes/bootstrap.inc	20 Sep 2008 20:22:23 -0000	1.228
+++ includes/bootstrap.inc	29 Sep 2008 22:13:55 -0000
@@ -500,15 +500,12 @@
  *
  * @param $name
  *   The name of the variable to return.
- * @param $default
- *   The default value to use if this variable has never been set.
  * @return
  *   The value of the variable.
  */
-function variable_get($name, $default) {
+function variable_get($name) {
   global $conf;
-
-  return isset($conf[$name]) ? $conf[$name] : $default;
+  return isset($conf[$name]) ? $conf[$name] : variable_default($name);
 }
 
 /**
@@ -522,15 +519,104 @@
  */
 function variable_set($name, $value) {
   global $conf;
-
-  db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
-
+  // Do not store default values in the database.
+  if ($value == variable_default($name)) {
+    variable_del($name);
+  }
+  else {
+    db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
+  }
+  // Clear the cache and reset the variable.
   cache_clear_all('variables', 'cache');
-
   $conf[$name] = $value;
 }
 
 /**
+ * Gets the default value for a given variable.
+ *
+ * @param $name
+ *   The name of the variable in question.
+ * @param $refresh
+ *   If TRUE, refreshes the internal static cache. Defaults to FALSE.
+ * @return
+ *   The default value for that variable, to be used in case no value is set.
+ */
+function variable_default($name, $refresh = FALSE) {
+  static $defaults;
+  static $invoked = FALSE;
+  if ($refresh) {
+    $defaults = array();
+    $invoked = FALSE;
+  }
+  if (empty($defaults)) {
+    // These variables need to be initialized here because they are required to
+    // exist before the database is set up and the variable system initialized.
+    $defaults['cache_inc'] = './includes/cache.inc';
+    $defaults['page_cache_fastpath'] = FALSE;
+    $defaults['blocked_ips'] = NULL;
+    $defaults['session_inc'] = './includes/session.inc';
+    $defaults['dev_query'] = 0;
+    $defaults['reverse_proxy'] = 0;
+    $defaults['reverse_proxy_addresses'] = array();
+    $defaults['cache'] = CACHE_DISABLED;
+    $defaults['cache_flush'] = 0;
+    $defaults['language_count'] = 1;
+    $defaults['session_write_interval'] = 180;
+    $defaults['site_frontpage'] = 'node';
+    $defaults['install_profile_modules'] = array();
+    $defaults['install_locale_batch_components'] = array();
+    $defaults['password_inc'] = './includes/password.inc';
+    $defaults['language_default'] = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
+  }
+  // We use function_exists() here, because the registry may not be available early on in the page process.
+  if (!$invoked && !isset($defaults[$name]) && !array_key_exists($name, $defaults) && function_exists('module_invoke_all') && function_exists('drupal_alter') && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) {
+    $invoked = TRUE;
+    $defaults += module_invoke_all('variables');
+    drupal_alter('variable_defaults', $defaults);
+  }
+  if (empty($name)) {
+    return NULL;
+  }
+  if (isset($defaults[$name]) || array_key_exists($name, $defaults)) {
+    return $defaults[$name];
+  }
+  // If we did not find the variable
+  $ancestor = variable_ancestor($name);
+  if ($ancestor) {
+    return variable_get($ancestor);
+  }
+  return NULL;
+}
+
+/**
+ * Returns the ancestor of a given variable. The ancestor is defined as the
+ * variable name with everything after the last underscore chopped off, and the
+ * last underscore chopped off too for good measure. For example, for the
+ * variable 'foo_bar_baz_32', the following variables would be looked for by
+ * the variable ancestry sytem:
+ *   * foo_bar_baz_32
+ *   * foo_bar_baz
+ *   * foo_bar
+ *   * foo
+ * If none of these are found, NULL is then returned by variable_default().
+ * FALSE is returned by this function once we get down to try to find the
+ * variable ancestor of 'foo'.
+ *
+ * @param $name
+ *   The name of the variable to return the ancestor of.
+ * @return
+ *   The ancestor of the variable specified in $name, or FALSE on failure.
+ */
+function variable_ancestor($name) {
+  $parts = explode('_', $name);
+  if (count($parts) === 1) {
+    return FALSE;
+  }
+  array_pop($parts);
+  return implode('_', $parts);
+}
+
+/**
  * Unset a persistent variable.
  *
  * @param $name
@@ -662,7 +748,7 @@
   header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
   header("Cache-Control: must-revalidate");
 
-  if (variable_get('page_compression', TRUE)) {
+  if (variable_get('page_compression')) {
     // Determine if the browser accepts gzipped data.
     if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) {
       // Strip the gzip header and run uncompress.
@@ -919,7 +1005,7 @@
   // Because this function is called on every page request, we first check
   // for an array of IP addresses in settings.php before querying the
   // database.
-  $blocked_ips = variable_get('blocked_ips', NULL);
+  $blocked_ips = variable_get('blocked_ips');
   if (isset($blocked_ips) && is_array($blocked_ips)) {
     return in_array($ip, $blocked_ips);
   }
@@ -1006,12 +1092,12 @@
     case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE:
       // Allow specifying special cache handlers in settings.php, like
       // using memcached or files for storing cache information.
-      require_once DRUPAL_ROOT . '/' . variable_get('cache_inc', 'includes/cache.inc');
+      require_once DRUPAL_ROOT . '/' . variable_get('cache_inc');
       // If the page_cache_fastpath is set to TRUE in settings.php and
       // page_cache_fastpath (implemented in the special implementation of
       // cache.inc) printed the page and indicated this with a returned TRUE
       // then we are done.
-      if (variable_get('page_cache_fastpath', FALSE) && page_cache_fastpath()) {
+      if (variable_get('page_cache_fastpath') && page_cache_fastpath()) {
         exit;
       }
       break;
@@ -1035,7 +1121,7 @@
       break;
 
     case DRUPAL_BOOTSTRAP_SESSION:
-      require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc');
+      require_once DRUPAL_ROOT . '/' . variable_get('session_inc');
       session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy_sid', '_sess_gc');
       session_start();
       break;
@@ -1045,7 +1131,7 @@
       $conf = variable_init(isset($conf) ? $conf : array());
       // Load module handling.
       require_once DRUPAL_ROOT . '/includes/module.inc';
-      $cache_mode = variable_get('cache', CACHE_DISABLED);
+      $cache_mode = variable_get('cache');
       // Get the page from the cache.
       $cache = $cache_mode == CACHE_DISABLED ? '' : page_get_cache();
       // If the skipping of the bootstrap hooks is not enforced, call hook_boot.
@@ -1116,7 +1202,7 @@
 
   // Ensure the language is correctly returned, even without multilanguage support.
   // Useful for eg. XML/HTML 'lang' attributes.
-  if (variable_get('language_count', 1) == 1) {
+  if (variable_get('language_count') == 1) {
     $language = language_default();
   }
   else {
@@ -1141,7 +1227,7 @@
 
   // Init language list
   if (!isset($languages)) {
-    if (variable_get('language_count', 1) > 1 || module_exists('locale')) {
+    if (variable_get('language_count') > 1 || module_exists('locale')) {
       $result = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC');
       while ($row = db_fetch_object($result)) {
         $languages['language'][$row->language] = $row;
@@ -1177,7 +1263,7 @@
  *   Optional property of the language object to return
  */
 function language_default($property = NULL) {
-  $language = variable_get('language_default', (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''));
+  $language = variable_get('language_default');
   return $property ? $language->$property : $language;
 }
 
@@ -1199,11 +1285,11 @@
   if (!isset($ip_address) || $reset) {
     $ip_address = $_SERVER['REMOTE_ADDR'];
 
-    if (variable_get('reverse_proxy', 0)) {
+    if (variable_get('reverse_proxy')) {
       if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
         // If an array of known reverse proxy IPs is provided, then trust
         // the XFF header if request really comes from one of them.
-        $reverse_proxy_addresses = variable_get('reverse_proxy_addresses', array());
+        $reverse_proxy_addresses = variable_get('reverse_proxy_addresses');
         if (!empty($reverse_proxy_addresses) && in_array($ip_address, $reverse_proxy_addresses, TRUE)) {
           // If there are several arguments, we need to check the most
           // recently added one, i.e. the last one.
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.71
diff -u -r1.71 install.inc
--- includes/install.inc	27 Sep 2008 20:03:35 -0000	1.71
+++ includes/install.inc	29 Sep 2008 22:13:56 -0000
@@ -590,6 +590,11 @@
     }
   }
 
+  // Delete the module's variables automagically.
+  foreach (array_keys(module_invoke($module, 'variables')) as $variable) {
+    variable_del($variable);
+  }
+
   drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
 }
 
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.187
diff -u -r1.187 locale.inc
--- includes/locale.inc	27 Sep 2008 20:23:30 -0000	1.187
+++ includes/locale.inc	29 Sep 2008 22:13:56 -0000
@@ -459,7 +459,7 @@
       LANGUAGE_NEGOTIATION_PATH_DEFAULT => t('Path prefix only.'),
       LANGUAGE_NEGOTIATION_PATH => t('Path prefix with language fallback.'),
       LANGUAGE_NEGOTIATION_DOMAIN => t('Domain name only.')),
-    '#default_value' => variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE),
+    '#default_value' => variable_get('language_negotiation'),
     '#description' => t("Select the mechanism used to determine your site's presentation language. <strong>Modifying this setting may break all incoming URLs and should be used with caution in a production environment.</strong>")
   );
   $form['submit'] = array(
@@ -963,7 +963,7 @@
 
   if ($enabled) {
     // Increment enabled language count if we are adding an enabled language.
-    variable_set('language_count', variable_get('language_count', 1) + 1);
+    variable_set('language_count', variable_get('language_count') + 1);
   }
 
   // Force JavaScript translation file creation for the newly added language.
@@ -1755,7 +1755,7 @@
 
   if (!isset($header)) {
     if (isset($language)) {
-      $header = '# ' . $language->name . ' translation of ' . variable_get('site_name', 'Drupal') . "\n";
+      $header = '# ' . $language->name . ' translation of ' . variable_get('site_name') . "\n";
       $header .= '# Generated by ' . $user->name . ' <' . $user->mail . ">\n";
       $header .= "#\n";
       $header .= "msgid \"\"\n";
@@ -2061,7 +2061,7 @@
  *   New content of the 'javascript_parsed' variable.
  */
 function _locale_invalidate_js($langcode = NULL) {
-  $parsed = variable_get('javascript_parsed', array());
+  $parsed = variable_get('javascript_parsed');
 
   if (empty($langcode)) {
     // Invalidate all languages.
@@ -2149,7 +2149,7 @@
 
   // Construct the filepath where JS translation files are stored.
   // There is (on purpose) no front end to edit that variable.
-  $dir = file_create_path(variable_get('locale_js_directory', 'languages'));
+  $dir = file_create_path(variable_get('locale_js_directory'));
 
   // Delete old file, if we have no translations anymore, or a different file to be saved.
   if (!empty($language->javascript) && (!$data || $language->javascript != $data_hash)) {
Index: includes/image.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/image.inc,v
retrieving revision 1.26
diff -u -r1.26 image.inc
--- includes/image.inc	8 Jul 2008 01:08:15 -0000	1.26
+++ includes/image.inc	29 Sep 2008 22:13:56 -0000
@@ -63,7 +63,7 @@
   static $toolkit;
 
   if (!$toolkit) {
-    $toolkit = variable_get('image_toolkit', 'gd');
+    $toolkit = variable_get('image_toolkit');
     if (isset($toolkit) &&
       drupal_function_exists("image_" . $toolkit . "_resize")) {
     }
Index: includes/password.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/password.inc,v
retrieving revision 1.3
diff -u -r1.3 password.inc
--- includes/password.inc	26 May 2008 17:12:54 -0000	1.3
+++ includes/password.inc	29 Sep 2008 22:13:56 -0000
@@ -15,23 +15,6 @@
  */
 
 /**
- * The standard log2 number of iterations for password stretching. This should
- * increase by 1 at least every other Drupal version in order to counteract
- * increases in the speed and power of computers available to crack the hashes.
- */
-define('DRUPAL_HASH_COUNT', 14);
-
-/**
- * The minimum allowed log2 number of iterations for password stretching.
- */
-define('DRUPAL_MIN_HASH_COUNT', 7);
-
-/**
- * The maximum allowed log2 number of iterations for password stretching.
- */
-define('DRUPAL_MAX_HASH_COUNT', 30);
-
-/**
  * Returns a string for mapping an int to the corresponding base 64 character.
  */
 function _password_itoa64() {
@@ -180,7 +163,7 @@
 function user_hash_password($password, $count_log2 = 0) {
   if (empty($count_log2)) {
     // Use the standard iteration count.
-    $count_log2 = variable_get('password_count_log2', DRUPAL_HASH_COUNT);
+    $count_log2 = variable_get('password_count_log2');
   }
   return _password_crypt($password, _password_generate_salt($count_log2));
 }
@@ -238,6 +221,6 @@
     return TRUE;
   }
   // Check whether the iteration count used differs from the standard number.
-  return (_password_get_count_log2($account->pass) != variable_get('password_count_log2', DRUPAL_HASH_COUNT));
+  return (_password_get_count_log2($account->pass) != variable_get('password_count_log2'));
 }
 
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.289
diff -u -r1.289 form.inc
--- includes/form.inc	27 Sep 2008 19:47:42 -0000	1.289
+++ includes/form.inc	29 Sep 2008 22:13:56 -0000
@@ -405,7 +405,7 @@
       // We'll clear out the cached copies of the form and its stored data
       // here, as we've finished with them. The in-memory copies are still
       // here, though.
-      if (variable_get('cache', CACHE_DISABLED) == CACHE_DISABLED && !empty($form_state['values']['form_build_id'])) {
+      if (variable_get('cache') == CACHE_DISABLED && !empty($form_state['values']['form_build_id'])) {
         cache_clear_all('form_' . $form_state['values']['form_build_id'], 'cache_form');
         cache_clear_all('storage_' . $form_state['values']['form_build_id'], 'cache_form');
       }
@@ -1663,7 +1663,7 @@
   $element['#tree'] = TRUE;
 
   // Determine the order of day, month, year in the site's chosen date format.
-  $format = variable_get('date_format_short', 'm/d/Y - H:i');
+  $format = variable_get('date_format_short');
   $sort = array();
   $sort['day'] = max(strpos($format, 'd'), strpos($format, 'j'));
   $sort['month'] = max(strpos($format, 'm'), strpos($format, 'M'));
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.437
diff -u -r1.437 theme.inc
--- includes/theme.inc	20 Sep 2008 20:22:23 -0000	1.437
+++ includes/theme.inc	29 Sep 2008 22:13:56 -0000
@@ -54,7 +54,7 @@
 
   // Only select the user selected theme if it is available in the
   // list of enabled themes.
-  $theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');
+  $theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default');
 
   // Allow modules to override the present theme... only select custom theme
   // if it is available in the list of installed themes.
@@ -884,10 +884,10 @@
       $defaults['toggle_node_info_' . $type] = 1;
     }
   }
-  $settings = array_merge($defaults, variable_get('theme_settings', array()));
+  $settings = array_merge($defaults, variable_get('theme_settings'));
 
   if ($key) {
-    $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_' . $key . '_settings'), array()));
+    $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_settings_' . $key), array()));
   }
 
   // Only offer search box if search.module is enabled.
@@ -925,7 +925,7 @@
     $theme_object = $themes[$theme_key];
 
     if ($settings['mission'] == '') {
-      $settings['mission'] = variable_get('site_mission', '');
+      $settings['mission'] = variable_get('site_mission');
     }
 
     if (!$settings['toggle_mission']) {
@@ -1654,7 +1654,7 @@
     $output .= ' (' . t('not verified') . ')';
   }
   else {
-    $output = variable_get('anonymous', t('Anonymous'));
+    $output = variable_get('anonymous');
   }
 
   return $output;
@@ -1818,12 +1818,12 @@
 
   // Construct page title
   if (drupal_get_title()) {
-    $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
+    $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name'));
   }
   else {
-    $head_title = array(variable_get('site_name', 'Drupal'));
-    if (variable_get('site_slogan', '')) {
-      $head_title[] = variable_get('site_slogan', '');
+    $head_title = array(variable_get('site_name'));
+    if (variable_get('site_slogan')) {
+      $head_title[] = variable_get('site_slogan');
     }
   }
   $variables['head_title']        = implode(' | ', $head_title);
@@ -1831,7 +1831,7 @@
   $variables['front_page']        = url();
   $variables['breadcrumb']        = theme('breadcrumb', drupal_get_breadcrumb());
   $variables['feed_icons']        = drupal_get_feeds();
-  $variables['footer_message']    = filter_xss_admin(variable_get('site_footer', FALSE));
+  $variables['footer_message']    = filter_xss_admin(variable_get('site_footer'));
   $variables['head']              = drupal_get_html_head();
   $variables['help']              = theme('help');
   $variables['language']          = $GLOBALS['language'];
@@ -1842,8 +1842,8 @@
   $variables['main_menu']     = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array();
   $variables['secondary_menu']   = theme_get_setting('toggle_secondary_menu') ? menu_secondary_menu() : array();
   $variables['search_box']        = (theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : '');
-  $variables['site_name']         = (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : '');
-  $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : '');
+  $variables['site_name']         = (theme_get_setting('toggle_name') ? variable_get('site_name') : '');
+  $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? variable_get('site_slogan') : '');
   $variables['css']               = drupal_add_css();
   $variables['styles']            = drupal_get_css();
   $variables['scripts']           = drupal_get_js();
Index: modules/syslog/syslog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/syslog/syslog.module,v
retrieving revision 1.18
diff -u -r1.18 syslog.module
--- modules/syslog/syslog.module	31 Aug 2008 09:15:13 -0000	1.18
+++ modules/syslog/syslog.module	29 Sep 2008 22:13:57 -0000
@@ -14,6 +14,15 @@
 }
 
 /**
+ * Implementation of hook_variables().
+ */
+function syslog_variables() {
+  return array(
+    'syslog_facility' => DEFAULT_SYSLOG_FACILITY,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function syslog_help($path, $arg) {
@@ -41,7 +50,6 @@
   $form['syslog_facility'] = array(
     '#type'          => 'select',
     '#title'         => t('Send events to this syslog facility'),
-    '#default_value' => variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY),
     '#options'       => syslog_facility_list(),
     '#description'   => t('Select the syslog facility code under which Drupal\'s messages should be sent. On UNIX/Linux systems, Drupal can flag its messages with the code LOG_LOCAL0 through LOG_LOCAL7; for Microsoft Windows, all messages are flagged with the code LOG_USER. Depending on the system configuration, syslog and other logging tools use this code to identify or filter Drupal messages from within the entire system log. For more information on syslog, see <a href="@syslog_help">Syslog help</a>.', array(
       '@syslog_help' => url('admin/help/syslog'))),
@@ -73,7 +81,7 @@
 
   if (!$log_init) {
     $log_init = TRUE;
-    openlog('drupal', LOG_NDELAY, variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY));
+    openlog('drupal', LOG_NDELAY, variable_get('syslog_facility'));
   }
 
   syslog($entry['severity'], theme('syslog_format', $entry));
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.464
diff -u -r1.464 forum.module
--- modules/forum/forum.module	19 Sep 2008 20:25:02 -0000	1.464
+++ modules/forum/forum.module	29 Sep 2008 22:13:56 -0000
@@ -7,6 +7,21 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function forum_variables() {
+  return array(
+    'forum_nav_vocabulary' => '',
+    'forum_containers' => array(),
+    'forum_hot_topic' => 15,
+    'forum_per_page' => 25,
+    'forum_order' => 1,
+    'forum_block_num_active' => 5,
+    'forum_block_num_new' => 5,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function forum_help($path, $arg) {
@@ -28,7 +43,7 @@
     case 'admin/build/forum/add/forum':
       return '<p>' . t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') . '</p>';
     case 'admin/build/forum/settings':
-      return '<p>' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the <em>Content types</em> on the <a href="@forum-vocabulary">forum vocabulary page</a>.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . '</p>';
+      return '<p>' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the <em>Content types</em> on the <a href="@forum-vocabulary">forum vocabulary page</a>.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary')))) . '</p>';
   }
 }
 
@@ -74,7 +89,7 @@
  *   An associative array containing the term data or FALSE if the term cannot be loaded, or is not part of the forum vocabulary.
  */
 function forum_term_load($tid) {
-  $result = db_query(db_rewrite_sql('SELECT t.tid, t.vid, t.name, t.description, t.weight FROM {term_data} t WHERE t.tid = %d AND t.vid = %d', 't', 'tid'), $tid, variable_get('forum_nav_vocabulary', ''));
+  $result = db_query(db_rewrite_sql('SELECT t.tid, t.vid, t.name, t.description, t.weight FROM {term_data} t WHERE t.tid = %d AND t.vid = %d', 't', 'tid'), $tid, variable_get('forum_nav_vocabulary'));
   return db_fetch_array($result);
 }
 
@@ -163,7 +178,7 @@
   // types assigned to the forum vocabulary.  If forum_nav_vocabulary
   // is undefined or the vocabulary does not exist, it clearly cannot
   // be assigned to $node->type, so return to avoid E_ALL warnings.
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   $vocabulary = taxonomy_vocabulary_load($vid);
   if (empty($vocabulary)) {
     return;
@@ -220,7 +235,7 @@
       if ($node->taxonomy) {
         // Extract the node's proper topic ID.
         $vocabulary = $vid;
-        $containers = variable_get('forum_containers', array());
+        $containers = variable_get('forum_containers');
         foreach ($node->taxonomy as $term) {
           if (db_result(db_query('SELECT COUNT(*) FROM {term_data} WHERE tid = %d AND vid = %d', $term, $vocabulary))) {
             if (in_array($term, $containers)) {
@@ -328,7 +343,7 @@
  * Implementation of hook_taxonomy().
  */
 function forum_taxonomy($op, $type, $term = NULL) {
-  if ($op == 'delete' && $term['vid'] == variable_get('forum_nav_vocabulary', '')) {
+  if ($op == 'delete' && $term['vid'] == variable_get('forum_nav_vocabulary')) {
     switch ($type) {
       case 'term':
         $results = db_query('SELECT tn.nid FROM {term_node} tn WHERE tn.tid = %d', $term['tid']);
@@ -338,7 +353,7 @@
         }
 
         // For containers, remove the tid from the forum_containers variable.
-        $containers = variable_get('forum_containers', array());
+        $containers = variable_get('forum_containers');
         $key = array_search($term['tid'], $containers);
         if ($key !== FALSE) {
           unset($containers[$key]);
@@ -355,7 +370,7 @@
  * Implementation of hook_form_alter().
  */
 function forum_form_alter(&$form, $form_state, $form_id) {
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   if (isset($form['vid']) && $form['vid']['#value'] == $vid) {
     // Hide critical options from forum vocabulary.
     if ($form_id == 'taxonomy_form_vocabulary') {
@@ -378,7 +393,7 @@
   }
   if ($form_id == 'forum_node_form') {
     // Make the vocabulary required for 'real' forum-nodes.
-    $vid = variable_get('forum_nav_vocabulary', '');
+    $vid = variable_get('forum_nav_vocabulary');
     $form['taxonomy'][$vid]['#required'] = TRUE;
     $form['taxonomy'][$vid]['#options'][''] = t('- Please choose -');
   }
@@ -407,7 +422,7 @@
       return $blocks;
 
     case 'configure':
-      $form['forum_block_num_' . $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_' . $delta, '5'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
+      $form['forum_block_num_' . $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_' . $delta), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
       return $form;
 
     case 'save':
@@ -420,14 +435,14 @@
           case 'active':
             $title = t('Active forum topics');
             $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid INNER JOIN {term_data} td ON td.tid = tn.tid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND td.vid = %d ORDER BY l.last_comment_timestamp DESC");
-            $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_active', '5'));
+            $result = db_query_range($sql, variable_get('forum_nav_vocabulary'), 0, variable_get('forum_block_num_active'));
             $content = node_title_list($result);
             break;
 
           case 'new':
             $title = t('New forum topics');
             $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid INNER JOIN {term_data} td ON td.tid = tn.tid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND td.vid = %d ORDER BY n.nid DESC");
-            $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_new', '5'));
+            $result = db_query_range($sql, variable_get('forum_nav_vocabulary'), 0, variable_get('forum_block_num_new'));
             $content = node_title_list($result);
             break;
         }
@@ -449,7 +464,7 @@
   $form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => !empty($node->title) ? $node->title : '', '#required' => TRUE, '#weight' => -5);
 
   if (!empty($node->nid)) {
-    $vid = variable_get('forum_nav_vocabulary', '');
+    $vid = variable_get('forum_nav_vocabulary');
     $forum_terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
     // if editing, give option to leave shadows
     $shadow = (count($forum_terms) > 1);
@@ -487,7 +502,7 @@
 function forum_get_forums($tid = 0) {
 
   $forums = array();
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   $_forums = taxonomy_get_tree($vid, $tid);
 
   if (count($_forums)) {
@@ -503,7 +518,7 @@
   }
 
   foreach ($_forums as $forum) {
-    if (in_array($forum->tid, variable_get('forum_containers', array()))) {
+    if (in_array($forum->tid, variable_get('forum_containers'))) {
       $forum->container = 1;
     }
 
@@ -635,7 +650,7 @@
 function template_preprocess_forums(&$variables) {
   global $user;
 
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   $vocabulary = taxonomy_vocabulary_load($vid);
   $title = !empty($vocabulary->name) ? $vocabulary->name : '';
 
@@ -691,7 +706,7 @@
       $variables['forums'] = '';
     }
 
-    if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers', array()))) {
+    if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers'))) {
       $variables['topics'] = theme('forum_topic_list', $variables['tid'], $variables['topics'], $variables['sortby'], $variables['forum_per_page']);
       drupal_add_feed(url('taxonomy/term/' . $variables['tid'] . '/0/feed'), 'RSS - ' . $title);
     }
@@ -846,7 +861,7 @@
  * @see theme_forum_icon()
  */
 function template_preprocess_forum_icon(&$variables) {
-  $variables['hot_threshold'] = variable_get('forum_hot_topic', 15);
+  $variables['hot_threshold'] = variable_get('forum_hot_topic');
   if ($variables['num_posts'] > $variables['hot_threshold']) {
     $variables['icon'] = $variables['new_posts'] ? 'hot-new' : 'hot';
   }
@@ -875,7 +890,7 @@
   $output = '';
 
   // get previous and next topic
-  $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 ORDER BY n.sticky DESC, " . _forum_get_topic_order_sql(variable_get('forum_order', 1));
+  $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 ORDER BY n.sticky DESC, " . _forum_get_topic_order_sql(variable_get('forum_order'));
   $result = db_query(db_rewrite_sql($sql), isset($variables['node']->tid) ? $variables['node']->tid : 0);
 
   $stop = $variables['prev'] = $variables['next'] = 0;
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.19
diff -u -r1.19 forum.install
--- modules/forum/forum.install	25 Jun 2008 07:47:20 -0000	1.19
+++ modules/forum/forum.install	29 Sep 2008 22:13:56 -0000
@@ -12,7 +12,7 @@
 }
 
 function forum_enable() {
-  if ($vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0))) {
+  if ($vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary'))) {
     // Existing install. Add back forum node type, if the forums
     // vocabulary still exists. Keep all other node types intact there.
     $vocabulary = (array) $vocabulary;
@@ -47,17 +47,10 @@
   drupal_load('module', 'taxonomy');
 
   // Delete the vocabulary.
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   taxonomy_del_vocabulary($vid);
 
   db_query('DROP TABLE {forum}');
-  variable_del('forum_containers');
-  variable_del('forum_nav_vocabulary');
-  variable_del('forum_hot_topic');
-  variable_del('forum_per_page');
-  variable_del('forum_order');
-  variable_del('forum_block_num_active');
-  variable_del('forum_block_num_new');
 }
 
 /**
@@ -108,7 +101,7 @@
 function forum_update_6000() {
   $ret = array();
 
-  $vid = variable_get('forum_nav_vocabulary', 0);
+  $vid = variable_get('forum_nav_vocabulary');
   $vocabularies = taxonomy_get_vocabularies();
   if (!isset($vocabularies[$vid])) {
     $vocabulary = array(
Index: modules/forum/forum.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.test,v
retrieving revision 1.4
diff -u -r1.4 forum.test
--- modules/forum/forum.test	19 Sep 2008 20:25:02 -0000	1.4
+++ modules/forum/forum.test	29 Sep 2008 22:13:56 -0000
@@ -117,7 +117,7 @@
    */
   function editForumTaxonomy() {
     // Backup forum taxonomy.
-    $vid = variable_get('forum_nav_vocabulary', '');
+    $vid = variable_get('forum_nav_vocabulary');
     // This function returns NULL (the cache value is false).
 //    $original_settings = taxonomy_vocabulary_load($vid);
     $original_settings = db_fetch_array(db_query('SELECT v.* FROM {vocabulary} v WHERE v.vid = %d', $vid));
@@ -197,7 +197,7 @@
     $this->assertRaw(t('Created new @type %term.', array('%term' => $name, '@type' => t($type))), t(ucfirst($type) . ' was created'));
 
     // Verify forum.
-    $term = db_fetch_array(db_query("SELECT * FROM {term_data} t WHERE t.vid = %d AND t.name = '%s' AND t.description = '%s'", variable_get('forum_nav_vocabulary', ''), $name, $description));
+    $term = db_fetch_array(db_query("SELECT * FROM {term_data} t WHERE t.vid = %d AND t.name = '%s' AND t.description = '%s'", variable_get('forum_nav_vocabulary'), $name, $description));
     $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database');
 
     // Verify forum hierarchy.
Index: modules/forum/forum.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.pages.inc,v
retrieving revision 1.2
diff -u -r1.2 forum.pages.inc
--- modules/forum/forum.pages.inc	26 Jul 2007 06:48:03 -0000	1.2
+++ modules/forum/forum.pages.inc	29 Sep 2008 22:13:56 -0000
@@ -11,12 +11,12 @@
  */
 function forum_page($tid = 0) {
   $topics = '';
-  $forum_per_page = variable_get('forum_per_page', 25);
-  $sortby = variable_get('forum_order', 1);
+  $forum_per_page = variable_get('forum_per_page');
+  $sortby = variable_get('forum_order');
 
   $forums = forum_get_forums($tid);
   $parents = taxonomy_get_parents_all($tid);
-  if ($tid && !in_array($tid, variable_get('forum_containers', array()))) {
+  if ($tid && !in_array($tid, variable_get('forum_containers'))) {
     $topics = forum_get_topics($tid, $sortby, $forum_per_page);
   }
 
Index: modules/forum/forum.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.admin.inc,v
retrieving revision 1.13
diff -u -r1.13 forum.admin.inc
--- modules/forum/forum.admin.inc	19 Sep 2008 20:25:02 -0000	1.13
+++ modules/forum/forum.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -54,7 +54,7 @@
     '#description' => t('Forums are displayed in ascending order by weight (forums with equal weights are displayed alphabetically).'),
   );
 
-  $form['vid'] = array('#type' => 'hidden', '#value' => variable_get('forum_nav_vocabulary', ''));
+  $form['vid'] = array('#type' => 'hidden', '#value' => variable_get('forum_nav_vocabulary'));
   $form['submit' ] = array('#type' => 'submit', '#value' => t('Save'));
   if ($edit['tid']) {
     $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
@@ -83,7 +83,7 @@
   switch ($status) {
     case SAVED_NEW:
       if ($container) {
-        $containers = variable_get('forum_containers', array());
+        $containers = variable_get('forum_containers');
         $containers[] = $form_state['values']['tid'];
         variable_set('forum_containers', $containers);
       }
@@ -138,7 +138,7 @@
 
   $form['vid'] = array(
     '#type' => 'hidden',
-    '#value' => variable_get('forum_nav_vocabulary', ''),
+    '#value' => variable_get('forum_nav_vocabulary'),
   );
   $form['submit'] = array(
     '#type' => 'submit',
@@ -190,21 +190,18 @@
   $number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500));
   $form['forum_hot_topic'] = array('#type' => 'select',
     '#title' => t('Hot topic threshold'),
-    '#default_value' => variable_get('forum_hot_topic', 15),
     '#options' => $number,
     '#description' => t('The number of posts a topic must have to be considered "hot".'),
   );
   $number = drupal_map_assoc(array(10, 25, 50, 75, 100));
   $form['forum_per_page'] = array('#type' => 'select',
     '#title' => t('Topics per page'),
-    '#default_value' => variable_get('forum_per_page', 25),
     '#options' => $number,
     '#description' => t('Default number of forum topics displayed per page.'),
   );
   $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4 => t('Posts - least active first'));
   $form['forum_order'] = array('#type' => 'radios',
     '#title' => t('Default order'),
-    '#default_value' => variable_get('forum_order', '1'),
     '#options' => $forder,
     '#description' => t('Default display order for topics.'),
   );
@@ -217,7 +214,7 @@
 function forum_overview(&$form_state) {
   module_load_include('inc', 'taxonomy', 'taxonomy.admin');
 
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   $vocabulary = taxonomy_vocabulary_load($vid);
   $form = taxonomy_overview_terms($form_state, $vocabulary);
   drupal_set_title('Forums');
@@ -226,7 +223,7 @@
     if (isset($form[$key]['#term'])) {
       $term = $form[$key]['#term'];
       $form[$key]['view']['#markup'] = l($term['name'], 'forum/' . $term['tid']);
-      if (in_array($form[$key]['#term']['tid'], variable_get('forum_containers', array()))) {
+      if (in_array($form[$key]['#term']['tid'], variable_get('forum_containers'))) {
         $form[$key]['edit']['#markup'] = l(t('edit container'), 'admin/build/forum/edit/container/' . $term['tid']);
       }
       else {
@@ -264,7 +261,7 @@
     $parent = 0;
   }
 
-  $vid = variable_get('forum_nav_vocabulary', '');
+  $vid = variable_get('forum_nav_vocabulary');
   $children = taxonomy_get_tree($vid, $tid);
 
   // A term can't be the child of itself, nor of its children.
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.27
diff -u -r1.27 dblog.module
--- modules/dblog/dblog.module	21 Aug 2008 19:36:37 -0000	1.27
+++ modules/dblog/dblog.module	29 Sep 2008 22:13:56 -0000
@@ -13,6 +13,15 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function dblog_variables() {
+  return array(
+    'dblog_row_limit' => 1000,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function dblog_help($path, $arg) {
@@ -97,7 +106,7 @@
 function dblog_cron() {
   // Cleanup the watchdog table
   $max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}'));
-  db_query('DELETE FROM {watchdog} WHERE wid <= %d', $max - variable_get('dblog_row_limit', 1000));
+  db_query('DELETE FROM {watchdog} WHERE wid <= %d', $max - variable_get('dblog_row_limit'));
 }
 
 /**
Index: modules/dblog/dblog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v
retrieving revision 1.9
diff -u -r1.9 dblog.test
--- modules/dblog/dblog.test	17 Sep 2008 07:11:56 -0000	1.9
+++ modules/dblog/dblog.test	29 Sep 2008 22:13:56 -0000
@@ -57,7 +57,7 @@
     $this->assertResponse(200);
 
     // Check row limit variable.
-    $current_limit = variable_get('dblog_row_limit', 1000);
+    $current_limit = variable_get('dblog_row_limit');
     $this->assertTrue($current_limit == $row_limit, t('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
     // Verify dblog row limit equals specified row limit.
     $current_limit = unserialize(db_result(db_query("SELECT value FROM {variable} WHERE name = '%s'", 'dblog_row_limit')));
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.8
diff -u -r1.8 dblog.admin.inc
--- modules/dblog/dblog.admin.inc	19 Jul 2008 07:44:45 -0000	1.8
+++ modules/dblog/dblog.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -16,7 +16,6 @@
   $form['dblog_row_limit'] = array(
     '#type' => 'select',
     '#title' => t('Discard log entries above the following row limit'),
-    '#default_value' => variable_get('dblog_row_limit', 1000),
     '#options' => drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)),
     '#description' => t('The maximum number of rows to keep in the database log. Older entries will be automatically discarded. (Requires a correctly configured <a href="@cron">cron maintenance task</a>.)', array('@cron' => url('admin/reports/status')))
   );
Index: modules/blogapi/blogapi.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v
retrieving revision 1.126
diff -u -r1.126 blogapi.module
--- modules/blogapi/blogapi.module	17 Sep 2008 21:07:47 -0000	1.126
+++ modules/blogapi/blogapi.module	29 Sep 2008 22:13:56 -0000
@@ -7,6 +7,15 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function blogapi_variables() {
+  return array(
+    'blogapi_node_types' => blogapi_node_types_default(),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function blogapi_help($path, $arg) {
@@ -193,7 +202,7 @@
   $edit = array();
   $edit['type'] = $blogid;
   // Get the node type defaults.
-  $node_type_default = variable_get('node_options_' . $edit['type'], array('status', 'promote'));
+  $node_type_default = variable_get('node_options_' . $edit['type'], array('status'));
   $edit['uid'] = $user->uid;
   $edit['name'] = $user->name;
   $edit['promote'] = in_array('promote', $node_type_default);
@@ -575,16 +584,21 @@
 }
 
 /**
+ * Returns the default value for the node types listing.
+ */
+function blogapi_node_types_default() {
+  $node_types = array_map('check_plain', node_get_types('names'));
+  return isset($node_types['blog']) ? array('blog' => 1) : array();
+}
+
+/**
  * Add some settings to the admin_settings form.
  */
 function blogapi_admin_settings() {
-  $node_types = array_map('check_plain', node_get_types('names'));
-  $defaults = isset($node_types['blog']) ? array('blog' => 1) : array();
   $form['blogapi_node_types'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Enable for external blogging clients'),
     '#required' => TRUE,
-    '#default_value' => variable_get('blogapi_node_types', $defaults),
     '#options' => $node_types,
     '#description' => t('Select the content types available to external blogging clients via Blog API. If supported, each enabled content type will be displayed as a separate "blog" by the external client.')
   );
@@ -741,7 +755,7 @@
 }
 
 function _blogapi_get_node_types() {
-  $available_types = array_keys(array_filter(variable_get('blogapi_node_types', array('blog' => 1))));
+  $available_types = array_keys(array_filter(variable_get('blogapi_node_types')));
   $types = array();
   foreach (node_get_types() as $type => $name) {
     if (node_access('create', $type) && in_array($type, $available_types)) {
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.269
diff -u -r1.269 system.install
--- modules/system/system.install	27 Sep 2008 20:16:17 -0000	1.269
+++ modules/system/system.install	29 Sep 2008 22:13:57 -0000
@@ -126,19 +126,19 @@
   // Report cron status.
   if ($phase == 'runtime') {
     // Cron warning threshold defaults to two days.
-    $threshold_warning = variable_get('cron_threshold_warning', 172800);
+    $threshold_warning = variable_get('cron_threshold_warning');
     // Cron error threshold defaults to two weeks.
-    $threshold_error = variable_get('cron_threshold_error', 1209600);
+    $threshold_error = variable_get('cron_threshold_error');
     // Cron configuration help text.
     $help = $t('For more information, see the online handbook entry for <a href="@cron-handbook">configuring cron jobs</a>.', array('@cron-handbook' => 'http://drupal.org/cron'));
 
     // Determine when cron last ran. If never, use the install time to
     // determine the warning or error status.
-    $cron_last = variable_get('cron_last', NULL);
+    $cron_last = variable_get('cron_last');
     $never_run = FALSE;
     if (!is_numeric($cron_last)) {
       $never_run = TRUE;
-      $cron_last = variable_get('install_time', 0);
+      $cron_last = variable_get('install_time');
     }
 
     // Determine severity based on time since cron last ran.
@@ -171,7 +171,7 @@
     }
 
     $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
-    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url('cron.php', array('absolute' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
+    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url('cron.php', array('absolute' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key')))));
 
     $requirements['cron'] = array(
       'title' => $t('Cron maintenance tasks'),
@@ -219,7 +219,7 @@
     }
   }
   else {
-    if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
+    if (variable_get('file_downloads') == FILE_DOWNLOADS_PUBLIC) {
       $requirements['file system']['value'] = $t('Writable (<em>public</em> download method)');
     }
     else {
@@ -284,7 +284,7 @@
       $requirements['update status'] = array(
         'value' => $t('Enabled'),
       );
-      if (variable_get('drupal_http_request_fails', FALSE)) {
+      if (variable_get('drupal_http_request_fails')) {
         $requirements['http requests'] = array(
           'title' => $t('HTTP request status'),
           'value' => $t('Fails'),
@@ -2018,7 +2018,7 @@
       $ret[] = update_sql("DELETE FROM {menu_links} WHERE menu_name IN ('" . implode("', '", $_SESSION['menu_bogus_menus']) . "')");
     }
 
-    $menu_primary_menu = variable_get('menu_primary_menu', 0);
+    $menu_primary_menu = variable_get('menu_primary_menu');
     // Ensure that we wind up with a system menu named 'primary-links'.
     if (isset($_SESSION['menu_menu_map'][2])) {
       // The primary links menu that ships with Drupal 5 has mid = 2.  If this
@@ -2045,7 +2045,7 @@
       $_SESSION['menu_menu_map'][$updated_primary_links_menu] = 'primary-links';
     }
 
-    $menu_secondary_menu = variable_get('menu_secondary_menu', 0);
+    $menu_secondary_menu = variable_get('menu_secondary_menu');
     // Ensure that we wind up with a system menu named 'secondary-links'.
     if (isset($_SESSION['menu_menu_map'][$menu_secondary_menu]) && $menu_secondary_menu > 1 && $menu_secondary_menu != $updated_primary_links_menu) {
       // We use the menu that is currently assigned to the secondary links
@@ -2070,7 +2070,7 @@
     }
 
     // Update menu OTF preferences.
-    $mid = variable_get('menu_parent_items', 0);
+    $mid = variable_get('menu_parent_items');
     $menu_name = ($mid && isset($_SESSION['menu_menu_map'][$mid])) ? $_SESSION['menu_menu_map'][$mid] : 'navigation';
     variable_set('menu_default_node_menu', $menu_name);
     variable_del('menu_parent_items');
@@ -2493,7 +2493,7 @@
 function system_update_6041() {
   $weight = intval((db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"))) + 1);
   $ret = array();
-  $vid = intval(variable_get('forum_nav_vocabulary', ''));
+  $vid = intval(variable_get('forum_nav_vocabulary'));
   if (db_table_exists('vocabulary') && $vid) {
     $ret[] = update_sql("UPDATE {vocabulary} SET required = 0 WHERE vid = " . $vid);
     $ret[] = update_sql("UPDATE {system} SET weight = " . $weight . " WHERE name = 'forum'");
@@ -2506,7 +2506,7 @@
  */
 function system_update_6042() {
   foreach (list_themes() as $theme) {
-    $stylesheet = variable_get('color_' . $theme->name . '_stylesheet', NULL);
+    $stylesheet = variable_get('color_' . $theme->name . '_stylesheet');
     if (!empty($stylesheet)) {
       variable_set('color_' . $theme->name . '_stylesheets', array($stylesheet));
       variable_del('color_' . $theme->name . '_stylesheet');
@@ -2621,7 +2621,7 @@
   $ret[] = update_sql("DELETE FROM {term_node} WHERE vid = 0");
 
   // Only execute the rest of this function if 6043 was run in RC1 or before.
-  if (variable_get('system_update_6043_RC2', FALSE)) {
+  if (variable_get('system_update_6043_RC2')) {
     variable_del('system_update_6043_RC2');
     return $ret;
   }
@@ -2685,7 +2685,7 @@
  */
 function system_update_6046() {
   $ret = array();
-  if (!variable_get('file_directory_path', FALSE)) {
+  if (!variable_get('file_directory_path')) {
     variable_set('file_directory_path', 'files');
     $ret[] = array('success' => TRUE, 'query' => "variable_set('file_directory_path')");
   }
@@ -2856,12 +2856,12 @@
       }
     }
     // Rename forum module's block variables.
-    $forum_block_num_0 = variable_get('forum_block_num_0', NULL);
+    $forum_block_num_0 = variable_get('forum_block_num_0');
     if (isset($forum_block_num_0)) {
       variable_set('forum_block_num_active', $forum_block_num_0);
       variable_del('forum_block_num_0');
     }
-    $forum_block_num_1 = variable_get('forum_block_num_1', NULL);
+    $forum_block_num_1 = variable_get('forum_block_num_1');
     if (isset($forum_block_num_1)) {
       variable_set('forum_block_num_new', $forum_block_num_1);
       variable_del('forum_block_num_1');
@@ -3048,6 +3048,38 @@
 }
 
 /**
+ * Update lots of variables for the variable renaming that comes along with the
+ * new hook_variables().
+ */
+function system_update_7011() {
+  $ret = array();
+  $renamings = array(
+    'color_%_screenshot' => 'color_screenshot_%',
+    'color_%_stylesheets' => 'color_stylesheets_%',
+    'color_%_logo' => 'color_logo_%',
+    'color_%_palette' => 'color_palette_%',
+    'color_%_files' => 'color_files_%',
+    'upload_extensions_default' => 'upload_extensions',
+    'upload_uploadsize_default' => 'upload_uploadsize',
+    'upload_usersize_default' => 'upload_usersize',
+    'user_mail_status_%_notify' => 'user_mail_notify_status_%',
+  );
+  foreach ($renamings as $variable => $renamed) {
+    $parts = explode('%', $variable);
+    // Escape the % for db_query().
+    $sql_variable = str_replace('%', '%%', $variable);
+    $result = db_query("SELECT name FROM {variable} WHERE name LIKE '$sql_variable'");
+    while ($data = db_fetch_array($result)) {
+      $old_name = $data['name'];
+      $name = str_replace($parts, '', $data['name']);
+      $renamed_variable = str_replace('%', $name, $renamed);
+      $ret[] = update_sql("UPDATE {variable} SET name = '$renamed_variable' WHERE name = '$old_name'");
+    }
+  }
+  return $ret;
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.12
diff -u -r1.12 system.test
--- modules/system/system.test	15 Sep 2008 20:48:09 -0000	1.12
+++ modules/system/system.test	29 Sep 2008 22:13:57 -0000
@@ -222,7 +222,7 @@
     $this->assertResponse(403);
 
     // Run cron anonymously with the valid cron key.
-    $key = variable_get('cron_key', 'drupal');
+    $key = variable_get('cron_key');
     $this->drupalGet('cron.php', array('query' => 'cron_key=' . $key));
     $this->assertResponse(200);
 
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.94
diff -u -r1.94 system.admin.inc
--- modules/system/system.admin.inc	27 Sep 2008 19:03:30 -0000	1.94
+++ modules/system/system.admin.inc	29 Sep 2008 22:13:57 -0000
@@ -153,14 +153,12 @@
     '#options' => $options,
     '#title' => t('Administration theme'),
     '#description' => t('Choose which theme the administration pages should display in. If you choose "System default" the administration pages will use the same theme as the rest of the site.'),
-    '#default_value' => variable_get('admin_theme', '0'),
   );
 
   $form['node_admin_theme'] = array(
     '#type' => 'checkbox',
     '#title' => t('Use administration theme for content editing'),
     '#description' => t('Use the administration theme when editing existing posts or creating new ones.'),
-    '#default_value' => variable_get('node_admin_theme', '0'),
   );
 
   $form['#submit'][] = 'system_admin_theme_submit';
@@ -203,7 +201,7 @@
     );
     $options[$theme->name] = '';
 
-    if (!empty($theme->status) || $theme->name == variable_get('admin_theme', '0')) {
+    if (!empty($theme->status) || $theme->name == variable_get('admin_theme')) {
       $form[$theme->name]['operations'] = array('#markup' => l(t('configure'), 'admin/build/themes/settings/' . $theme->name) );
     }
     else {
@@ -234,7 +232,7 @@
   $form['theme_default'] = array(
     '#type' => 'radios',
     '#options' => $options,
-    '#default_value' => variable_get('theme_default', 'garland'),
+    '#default_value' => variable_get('theme_default'),
   );
   $form['buttons']['submit'] = array(
     '#type' => 'submit',
@@ -272,7 +270,7 @@
         }
       }
     }
-    if (($admin_theme = variable_get('admin_theme', '0')) != '0' && $admin_theme != $form_state['values']['theme_default']) {
+    if (($admin_theme = variable_get('admin_theme')) != '0' && $admin_theme != $form_state['values']['theme_default']) {
       drupal_set_message(t('Please note that the <a href="!admin_theme_page">administration theme</a> is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array(
         '!admin_theme_page' => url('admin/settings/admin'),
         '%admin_theme' => $admin_theme,
@@ -376,7 +374,7 @@
 
   // Some features are not always available
   $disabled = array();
-  if (!variable_get('user_pictures', 0)) {
+  if (!variable_get('user_pictures')) {
     $disabled['toggle_node_user_picture'] = TRUE;
     $disabled['toggle_comment_user_picture'] = TRUE;
   }
@@ -1208,49 +1206,42 @@
   $form['site_name'] = array(
     '#type' => 'textfield',
     '#title' => t('Name'),
-    '#default_value' => variable_get('site_name', 'Drupal'),
     '#description' => t('The name of this website.'),
     '#required' => TRUE
   );
   $form['site_mail'] = array(
     '#type' => 'textfield',
     '#title' => t('E-mail address'),
-    '#default_value' => variable_get('site_mail', ini_get('sendmail_from')),
     '#description' => t("The <em>From</em> address in automated e-mails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this e-mail being flagged as spam.)"),
     '#required' => TRUE,
   );
   $form['site_slogan'] = array(
     '#type' => 'textfield',
     '#title' => t('Slogan'),
-    '#default_value' => variable_get('site_slogan', ''),
     '#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).")
   );
   $form['site_mission'] = array(
     '#type' => 'textarea',
     '#title' => t('Mission'),
-    '#default_value' => variable_get('site_mission', ''),
     '#description' => t("Your site's mission or focus statement (often prominently displayed on the front page).")
   );
   $form['site_footer'] = array(
     '#type' => 'textarea',
     '#title' => t('Footer message'),
-    '#default_value' => variable_get('site_footer', ''),
     '#description' => t('This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages.')
   );
   $form['anonymous'] = array(
     '#type' => 'textfield',
     '#title' => t('Anonymous user'),
-    '#default_value' => variable_get('anonymous', t('Anonymous')),
     '#description' => t('The name used to indicate anonymous users.'),
     '#required' => TRUE,
   );
   $form['site_frontpage'] = array(
     '#type' => 'textfield',
     '#title' => t('Default front page'),
-    '#default_value' => variable_get('site_frontpage', 'node'),
     '#size' => 40,
     '#description' => t('The home page displays content from this relative URL. If unsure, specify "node".'),
-    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
+    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q='),
     '#required' => TRUE,
   );
   $form['#validate'][] = 'system_site_information_settings_validate';
@@ -1289,23 +1280,21 @@
   $form['site_403'] = array(
     '#type' => 'textfield',
     '#title' => t('Default 403 (access denied) page'),
-    '#default_value' => variable_get('site_403', ''),
     '#size' => 40,
     '#description' => t('This page is displayed when the requested document is denied to the current user. If unsure, specify nothing.'),
-    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
+    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q=')
   );
 
   $form['site_404'] = array(
     '#type' => 'textfield',
     '#title' => t('Default 404 (not found) page'),
-    '#default_value' => variable_get('site_404', ''),
     '#size' => 40,
     '#description' => t('This page is displayed when no other content matches the requested document. If unsure, specify nothing.'),
-    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
+    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q=')
   );
 
   $form['error_level'] = array(
-    '#type' => 'select', '#title' => t('Error reporting'), '#default_value' => variable_get('error_level', 1),
+    '#type' => 'select', '#title' => t('Error reporting'),
     '#options' => array(t('Write errors to the log'), t('Write errors to the log and to the screen')),
     '#description' => t('Specify where Drupal, PHP and SQL errors are logged. While it is recommended that a site running in a production environment write errors to the log only, in a development or testing environment it may be helpful to write errors both to the log and to the screen.')
   );
@@ -1353,7 +1342,6 @@
   $form['page_cache']['cache'] = array(
     '#type' => 'radios',
     '#title' => t('Caching mode'),
-    '#default_value' => variable_get('cache', CACHE_DISABLED),
     '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal (recommended for production sites, no side effects)'), CACHE_AGGRESSIVE => t('Aggressive (experts only, possible side effects)')),
     '#description' => $description
   );
@@ -1363,14 +1351,12 @@
   $form['page_cache']['cache_lifetime'] = array(
     '#type' => 'select',
     '#title' => t('Minimum cache lifetime'),
-    '#default_value' => variable_get('cache_lifetime', 0),
     '#options' => $period,
     '#description' => t('On high-traffic sites, it may be necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied and recreated, and is applied to both page and block caches. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.')
   );
   $form['page_cache']['page_compression'] = array(
     '#type' => 'radios',
     '#title' => t('Page compression'),
-    '#default_value' => variable_get('page_compression', TRUE),
     '#options' => array(t('Disabled'), t('Enabled')),
     '#description' => t("By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression."),
   );
@@ -1384,7 +1370,6 @@
   $form['block_cache']['block_cache'] = array(
     '#type' => 'radios',
     '#title' => t('Block cache'),
-    '#default_value' => variable_get('block_cache', CACHE_DISABLED),
     '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Enabled (recommended)')),
     '#disabled' => count(module_implements('node_grants')),
     '#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'),
@@ -1397,11 +1382,11 @@
   );
 
   $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads') == FILE_DOWNLOADS_PUBLIC);
   $form['bandwidth_optimizations']['preprocess_css'] = array(
     '#type' => 'radios',
     '#title' => t('Optimize CSS files'),
-    '#default_value' => intval(variable_get('preprocess_css', 0) && $is_writable),
+    '#default_value' => intval(variable_get('preprocess_css') && $is_writable),
     '#disabled' => !$is_writable,
     '#options' => array(t('Disabled'), t('Enabled')),
     '#description' => t('This option can interfere with theme development and should only be enabled in a production environment.'),
@@ -1409,7 +1394,7 @@
   $form['bandwidth_optimizations']['preprocess_js'] = array(
     '#type' => 'radios',
     '#title' => t('Optimize JavaScript files'),
-    '#default_value' => intval(variable_get('preprocess_js', 0) && $is_writable),
+    '#default_value' => intval(variable_get('preprocess_js') && $is_writable),
     '#disabled' => !$is_writable,
     '#options' => array(t('Disabled'), t('Enabled')),
     '#description' => t('This option can interfere with module development and should only be enabled in a production environment.'),
@@ -1472,7 +1457,6 @@
   $form['file_downloads'] = array(
     '#type' => 'radios',
     '#title' => t('Download method'),
-    '#default_value' => variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC),
     '#options' => array(FILE_DOWNLOADS_PUBLIC => t('Public - files are available using HTTP directly.'), FILE_DOWNLOADS_PRIVATE => t('Private - files are transferred by Drupal.')),
     '#description' => t('Choose the <em>Public download</em> method unless you wish to enforce fine-grained access controls over file downloads. Changing the download method will modify all download paths and may cause unexpected problems on an existing site.')
   );
@@ -1492,7 +1476,6 @@
     $form['image_toolkit'] = array(
       '#type' => 'radios',
       '#title' => t('Select an image processing toolkit'),
-      '#default_value' => variable_get('image_toolkit', image_get_toolkit()),
       '#options' => $toolkits_available
     );
   }
@@ -1516,14 +1499,12 @@
   $form['feed_default_items'] = array(
     '#type' => 'select',
     '#title' => t('Number of items in each feed'),
-    '#default_value' => variable_get('feed_default_items', 10),
     '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)),
     '#description' => t('Default number of items to include in each feed.')
   );
   $form['feed_item_length'] = array(
     '#type' => 'select',
     '#title' => t('Feed content'),
-    '#default_value' => variable_get('feed_item_length', 'teaser'),
     '#options' => array('title' => t('Titles only'), 'teaser' => t('Titles plus teaser'), 'fulltext' => t('Full text')),
     '#description' => t('Global setting for the default display of content items in each feed.')
   );
@@ -1578,7 +1559,6 @@
   $form['locale']['date_default_timezone'] = array(
     '#type' => 'select',
     '#title' => t('Default time zone'),
-    '#default_value' => variable_get('date_default_timezone', 0),
     '#options' => $zones,
     '#description' => t('Select the default site time zone.')
   );
@@ -1586,7 +1566,6 @@
   $form['locale']['configurable_timezones'] = array(
     '#type' => 'radios',
     '#title' => t('User-configurable time zones'),
-    '#default_value' => variable_get('configurable_timezones', 1),
     '#options' => array(t('Disabled'), t('Enabled')),
     '#description' => t('When enabled, users can set their own time zone and dates will be displayed accordingly.')
   );
@@ -1594,7 +1573,6 @@
   $form['locale']['date_first_day'] = array(
     '#type' => 'select',
     '#title' => t('First day of week'),
-    '#default_value' => variable_get('date_first_day', 0),
     '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')),
     '#description' => t('The first day of the week for calendar views.')
   );
@@ -1604,7 +1582,7 @@
     '#title' => t('Formatting'),
   );
 
-  $date_format_short = variable_get('date_format_short', $date_short[1]);
+  $date_format_short = variable_get('date_format_short');
   $form['date_formats']['date_format_short'] = array(
     '#prefix' => '<div class="date-container"><div class="select-container">',
     '#suffix' => '</div>',
@@ -1616,7 +1594,7 @@
     '#description' => t('The short format of date display.'),
   );
 
-  $default_short_custom = variable_get('date_format_short_custom', (isset($date_short_choices[$date_format_short]) ? $date_format_short : ''));
+  $default_short_custom = variable_get('date_format_short_custom');
   $form['date_formats']['date_format_short_custom'] = array(
     '#prefix' => '<div class="custom-container">',
     '#suffix' => '</div></div>',
@@ -1627,7 +1605,7 @@
     '#description' => t('A user-defined short date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(REQUEST_TIME, 'custom', $default_short_custom))),
   );
 
-  $date_format_medium = variable_get('date_format_medium', $date_medium[1]);
+  $date_format_medium = variable_get('date_format_medium');
   $form['date_formats']['date_format_medium'] = array(
     '#prefix' => '<div class="date-container"><div class="select-container">',
     '#suffix' => '</div>',
@@ -1639,7 +1617,7 @@
     '#description' => t('The medium sized date display.'),
   );
 
-  $default_medium_custom = variable_get('date_format_medium_custom', (isset($date_medium_choices[$date_format_medium]) ? $date_format_medium : ''));
+  $default_medium_custom = variable_get('date_format_medium_custom');
   $form['date_formats']['date_format_medium_custom'] = array(
     '#prefix' => '<div class="custom-container">',
     '#suffix' => '</div></div>',
@@ -1650,7 +1628,7 @@
     '#description' => t('A user-defined medium date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(REQUEST_TIME, 'custom', $default_medium_custom))),
   );
 
-  $date_format_long = variable_get('date_format_long', $date_long[0]);
+  $date_format_long = variable_get('date_format_long');
   $form['date_formats']['date_format_long'] = array(
     '#prefix' => '<div class="date-container"><div class="select-container">',
     '#suffix' => '</div>',
@@ -1662,7 +1640,7 @@
     '#description' => t('Longer date format used for detailed display.')
   );
 
-  $default_long_custom = variable_get('date_format_long_custom', (isset($date_long_choices[$date_format_long]) ? $date_format_long : ''));
+  $default_long_custom = variable_get('date_format_long_custom');
   $form['date_formats']['date_format_long_custom'] = array(
     '#prefix' => '<div class="custom-container">',
     '#suffix' => '</div></div>',
@@ -1715,7 +1693,6 @@
   $form['site_offline'] = array(
     '#type' => 'radios',
     '#title' => t('Site status'),
-    '#default_value' => variable_get('site_offline', 0),
     '#options' => array(t('Online'), t('Offline')),
     '#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site offline message configured below. Authorized users can log in during "Offline" mode directly via the <a href="@user-login">user login</a> page.', array('@user-login' => url('user'))),
   );
@@ -1723,7 +1700,6 @@
   $form['site_offline_message'] = array(
     '#type' => 'textarea',
     '#title' => t('Site offline message'),
-    '#default_value' => variable_get('site_offline_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))),
     '#description' => t('Message to show visitors when the site is in offline mode.')
   );
 
@@ -1740,12 +1716,11 @@
   $form['clean_url'] = array(
     '#type' => 'radios',
     '#title' => t('Clean URLs'),
-    '#default_value' => variable_get('clean_url', 0),
     '#options' => array(t('Disabled'), t('Enabled')),
     '#description' => t('This option makes Drupal emit "clean" URLs (i.e. without <code>?q=</code> in the URL).'),
   );
 
-  if (!variable_get('clean_url', 0)) {
+  if (!variable_get('clean_url')) {
     if (strpos(request_uri(), '?q=') !== FALSE) {
       drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module');
 
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.624
diff -u -r1.624 system.module
--- modules/system/system.module	27 Sep 2008 19:47:43 -0000	1.624
+++ modules/system/system.module	29 Sep 2008 22:13:57 -0000
@@ -42,6 +42,434 @@
 define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
 
 /**
+ * Implementation of hook_variables().
+ */
+function system_variables() {
+  return array(
+    'cron_key' => 'drupal',
+    'install_profile_modules' => array(),
+    'site_name' => 'Drupal',
+    'site_mail' => ini_get('sendmail_from'),
+    'install_locale_batch_components' => array(),
+    'update_d6_requirements' => FALSE,
+    'actions_max_stack' => 35,
+    'page_compression' => TRUE,
+    'cache_flush' => 0,
+    'cache_lifetime' => 0,
+    'site_404' => '',
+    'site_403' => '',
+    'drupal_http_request_fails' => FALSE,
+    'error_level' => 1,
+    'configurable_timezones' => 1,
+    'date_default_timezone' => 0,
+    'date_format_short' => 'm/d/Y - H:i',
+    'date_format_long' => 'l, F j, Y - H:i',
+    'date_format_medium' => 'D, m/d/Y - H:i',
+    'clean_url' => '0',
+    'preprocess_css' => FALSE,
+    'file_downloads' => FILE_DOWNLOADS_PUBLIC,
+    'css_js_query_string' => '0',
+    'preprocess_js' => FALSE,
+    'drupal_private_key' => '',
+    'cron_semaphore' => FALSE,
+    'install_profile' => 'default',
+    'anonymous' => 'Anonymous',
+    'allow_insecure_uploads' => 0,
+    'upload_extensions_default' => 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp',
+    'file_directory_temp' => NULL,
+    'file_directory_path' => conf_path() . '/files',
+    'image_toolkit' => 'gd',
+    'language_negotiation' => LANGUAGE_NEGOTIATION_NONE,
+    'javascript_parsed' => array(),
+    'locale_js_directory' => 'languages',
+    'smtp_library' => '',
+    'menu_masks' => array(),
+    'menu_rebuild_needed' => FALSE,
+    'menu_expanded' => array(),
+    'menu_main_menu_source' => 'main-menu',
+    'menu_secondary_menu_source' => 'secondary-menu',
+    'site_offline' => 0,
+    'theme_default' => 'garland',
+    'theme_settings' => array(),
+    'site_mission' => '',
+    'site_slogan' => '',
+    'site_footer' => '',
+    'maintenance_theme' => 'minnelli',
+    'site_slogan' => '',
+    'admin_theme' => 0,
+    'node_admin_theme' => 0,
+    'image_jpeg_quality' => 75,
+    'date_first_day' => 0,
+    'date_format_short_custom' => '',
+    'date_format_medium_custom' => '',
+    'date_format_long_custom' => '',
+    'site_offline_message' => '@site is currently under maintenance. We should be back shortly. Thank you for your patience.',
+    'cron_threshold_warning' => 172800,
+    'cron_threshold_error' => 1209600,
+    'cron_last' => NULL,
+    'install_time' => 0,
+    'menu_primary_menu' => 0,
+    'menu_secondary_menu' => 0,
+    'menu_parent_items' => 0,
+    'system_update_6043_RC2' => FALSE,
+    'forum_block_num_0' => NULL,
+    'forum_block_num_1' => NULL,
+    'drupal_badge_color' => 'powered-blue',
+    'drupal_badge_size' => '80x15',
+    'admin_compact_mode' => FALSE,
+    'locale_custom_strings' => array(),
+    'mime_extension_mapping' => array(
+      'ez' => 'application/andrew-inset',
+      'atom' => 'application/atom',
+      'atomcat' => 'application/atomcat+xml',
+      'atomsrv' => 'application/atomserv+xml',
+      'cap|pcap' => 'application/cap',
+      'cu' => 'application/cu-seeme',
+      'tsp' => 'application/dsptype',
+      'spl' => 'application/x-futuresplash',
+      'hta' => 'application/hta',
+      'jar' => 'application/java-archive',
+      'ser' => 'application/java-serialized-object',
+      'class' => 'application/java-vm',
+      'hqx' => 'application/mac-binhex40',
+      'cpt' => 'image/x-corelphotopaint',
+      'nb' => 'application/mathematica',
+      'mdb' => 'application/msaccess',
+      'doc|dot' => 'application/msword',
+      'bin' => 'application/octet-stream',
+      'oda' => 'application/oda',
+      'ogg|ogx' => 'application/ogg',
+      'pdf' => 'application/pdf',
+      'key' => 'application/pgp-keys',
+      'pgp' => 'application/pgp-signature',
+      'prf' => 'application/pics-rules',
+      'ps|ai|eps' => 'application/postscript',
+      'rar' => 'application/rar',
+      'rdf' => 'application/rdf+xml',
+      'rss' => 'application/rss+xml',
+      'rtf' => 'application/rtf',
+      'smi|smil' => 'application/smil',
+      'wpd' => 'application/wordperfect',
+      'wp5' => 'application/wordperfect5.1',
+      'xhtml|xht' => 'application/xhtml+xml',
+      'xml|xsl' => 'application/xml',
+      'zip' => 'application/zip',
+      'cdy' => 'application/vnd.cinderella',
+      'kml' => 'application/vnd.google-earth.kml+xml',
+      'kmz' => 'application/vnd.google-earth.kmz',
+      'xul' => 'application/vnd.mozilla.xul+xml',
+      'xls|xlb|xlt' => 'application/vnd.ms-excel',
+      'cat' => 'application/vnd.ms-pki.seccat',
+      'stl' => 'application/vnd.ms-pki.stl',
+      'ppt|pps' => 'application/vnd.ms-powerpoint',
+      'odc' => 'application/vnd.oasis.opendocument.chart',
+      'odb' => 'application/vnd.oasis.opendocument.database',
+      'odf' => 'application/vnd.oasis.opendocument.formula',
+      'odg' => 'application/vnd.oasis.opendocument.graphics',
+      'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+      'odi' => 'application/vnd.oasis.opendocument.image',
+      'odp' => 'application/vnd.oasis.opendocument.presentation',
+      'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+      'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+      'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+      'odt' => 'application/vnd.oasis.opendocument.text',
+      'odm' => 'application/vnd.oasis.opendocument.text-master',
+      'ott' => 'application/vnd.oasis.opendocument.text-template',
+      'oth' => 'application/vnd.oasis.opendocument.text-web',
+      'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
+      'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+      'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+      'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+      'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
+      'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+      'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
+      'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+      'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+      'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+      'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+      'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+      'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+      'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+      'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+      'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
+      'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+      'cod' => 'application/vnd.rim.cod',
+      'mmf' => 'application/vnd.smaf',
+      'sdc' => 'application/vnd.stardivision.calc',
+      'sds' => 'application/vnd.stardivision.chart',
+      'sda' => 'application/vnd.stardivision.draw',
+      'sdd' => 'application/vnd.stardivision.impress',
+      'sdf' => 'application/vnd.stardivision.math',
+      'sdw' => 'application/vnd.stardivision.writer',
+      'sgl' => 'application/vnd.stardivision.writer-global',
+      'sxc' => 'application/vnd.sun.xml.calc',
+      'stc' => 'application/vnd.sun.xml.calc.template',
+      'sxd' => 'application/vnd.sun.xml.draw',
+      'std' => 'application/vnd.sun.xml.draw.template',
+      'sxi' => 'application/vnd.sun.xml.impress',
+      'sti' => 'application/vnd.sun.xml.impress.template',
+      'sxm' => 'application/vnd.sun.xml.math',
+      'sxw' => 'application/vnd.sun.xml.writer',
+      'sxg' => 'application/vnd.sun.xml.writer.global',
+      'stw' => 'application/vnd.sun.xml.writer.template',
+      'sis' => 'application/vnd.symbian.install',
+      'vsd' => 'application/vnd.visio',
+      'wbxml' => 'application/vnd.wap.wbxml',
+      'wmlc' => 'application/vnd.wap.wmlc',
+      'wmlsc' => 'application/vnd.wap.wmlscriptc',
+      'wk' => 'application/x-123',
+      '7z' => 'application/x-7z-compressed',
+      'abw' => 'application/x-abiword',
+      'dmg' => 'application/x-apple-diskimage',
+      'bcpio' => 'application/x-bcpio',
+      'torrent' => 'application/x-bittorrent',
+      'cab' => 'application/x-cab',
+      'cbr' => 'application/x-cbr',
+      'cbz' => 'application/x-cbz',
+      'cdf' => 'application/x-cdf',
+      'vcd' => 'application/x-cdlink',
+      'pgn' => 'application/x-chess-pgn',
+      'cpio' => 'application/x-cpio',
+      'csh' => 'text/x-csh',
+      'deb|udeb' => 'application/x-debian-package',
+      'dcr|dir|dxr' => 'application/x-director',
+      'dms' => 'application/x-dms',
+      'wad' => 'application/x-doom',
+      'dvi' => 'application/x-dvi',
+      'rhtml' => 'application/x-httpd-eruby',
+      'flac' => 'application/x-flac',
+      'pfa|pfb|gsf|pcf|pcf.Z' => 'application/x-font',
+      'mm' => 'application/x-freemind',
+      'gnumeric' => 'application/x-gnumeric',
+      'sgf' => 'application/x-go-sgf',
+      'gcf' => 'application/x-graphing-calculator',
+      'gtar|tgz|taz' => 'application/x-gtar',
+      'hdf' => 'application/x-hdf',
+      'phtml|pht|php' => 'application/x-httpd-php',
+      'phps' => 'application/x-httpd-php-source',
+      'php3' => 'application/x-httpd-php3',
+      'php3p' => 'application/x-httpd-php3-preprocessed',
+      'php4' => 'application/x-httpd-php4',
+      'ica' => 'application/x-ica',
+      'ins|isp' => 'application/x-internet-signup',
+      'iii' => 'application/x-iphone',
+      'iso' => 'application/x-iso9660-image',
+      'jnlp' => 'application/x-java-jnlp-file',
+      'js' => 'application/x-javascript',
+      'jmz' => 'application/x-jmol',
+      'chrt' => 'application/x-kchart',
+      'kil' => 'application/x-killustrator',
+      'skp|skd|skt|skm' => 'application/x-koan',
+      'kpr|kpt' => 'application/x-kpresenter',
+      'ksp' => 'application/x-kspread',
+      'kwd|kwt' => 'application/x-kword',
+      'latex' => 'application/x-latex',
+      'lha' => 'application/x-lha',
+      'lyx' => 'application/x-lyx',
+      'lzh' => 'application/x-lzh',
+      'lzx' => 'application/x-lzx',
+      'frm|maker|frame|fm|fb|book|fbdoc' => 'application/x-maker',
+      'mif' => 'application/x-mif',
+      'wmd' => 'application/x-ms-wmd',
+      'wmz' => 'application/x-ms-wmz',
+      'com|exe|bat|dll' => 'application/x-msdos-program',
+      'msi' => 'application/x-msi',
+      'nc' => 'application/x-netcdf',
+      'pac' => 'application/x-ns-proxy-autoconfig',
+      'nwc' => 'application/x-nwc',
+      'o' => 'application/x-object',
+      'oza' => 'application/x-oz-application',
+      'p7r' => 'application/x-pkcs7-certreqresp',
+      'crl' => 'application/x-pkcs7-crl',
+      'pyc|pyo' => 'application/x-python-code',
+      'qtl' => 'application/x-quicktimeplayer',
+      'rpm' => 'application/x-redhat-package-manager',
+      'sh' => 'text/x-sh',
+      'shar' => 'application/x-shar',
+      'swf|swfl' => 'application/x-shockwave-flash',
+      'sit|sitx' => 'application/x-stuffit',
+      'sv4cpio' => 'application/x-sv4cpio',
+      'sv4crc' => 'application/x-sv4crc',
+      'tar' => 'application/x-tar',
+      'tcl' => 'application/x-tcl',
+      'gf' => 'application/x-tex-gf',
+      'pk' => 'application/x-tex-pk',
+      'texinfo|texi' => 'application/x-texinfo',
+      '~|%|bak|old|sik' => 'application/x-trash',
+      't|tr|roff' => 'application/x-troff',
+      'man' => 'application/x-troff-man',
+      'me' => 'application/x-troff-me',
+      'ms' => 'application/x-troff-ms',
+      'ustar' => 'application/x-ustar',
+      'src' => 'application/x-wais-source',
+      'wz' => 'application/x-wingz',
+      'crt' => 'application/x-x509-ca-cert',
+      'xcf' => 'application/x-xcf',
+      'fig' => 'application/x-xfig',
+      'xpi' => 'application/x-xpinstall',
+      'au|snd' => 'audio/basic',
+      'mid|midi|kar' => 'audio/midi',
+      'mpga|mpega|mp2|mp3|m4a' => 'audio/mpeg',
+      'm3u' => 'audio/x-mpegurl',
+      'oga|spx' => 'audio/ogg',
+      'sid' => 'audio/prs.sid',
+      'aif|aiff|aifc' => 'audio/x-aiff',
+      'gsm' => 'audio/x-gsm',
+      'wma' => 'audio/x-ms-wma',
+      'wax' => 'audio/x-ms-wax',
+      'ra|rm|ram' => 'audio/x-pn-realaudio',
+      'ra' => 'audio/x-realaudio',
+      'pls' => 'audio/x-scpls',
+      'sd2' => 'audio/x-sd2',
+      'wav' => 'audio/x-wav',
+      'alc' => 'chemical/x-alchemy',
+      'cac|cache' => 'chemical/x-cache',
+      'csf' => 'chemical/x-cache-csf',
+      'cbin|cascii|ctab' => 'chemical/x-cactvs-binary',
+      'cdx' => 'chemical/x-cdx',
+      'cer' => 'chemical/x-cerius',
+      'c3d' => 'chemical/x-chem3d',
+      'chm' => 'chemical/x-chemdraw',
+      'cif' => 'chemical/x-cif',
+      'cmdf' => 'chemical/x-cmdf',
+      'cml' => 'chemical/x-cml',
+      'cpa' => 'chemical/x-compass',
+      'bsd' => 'chemical/x-crossfire',
+      'csml|csm' => 'chemical/x-csml',
+      'ctx' => 'chemical/x-ctx',
+      'cxf|cef' => 'chemical/x-cxf',
+      'emb|embl' => 'chemical/x-embl-dl-nucleotide',
+      'spc' => 'chemical/x-galactic-spc',
+      'inp|gam|gamin' => 'chemical/x-gamess-input',
+      'fch|fchk' => 'chemical/x-gaussian-checkpoint',
+      'cub' => 'chemical/x-gaussian-cube',
+      'gau|gjc|gjf' => 'chemical/x-gaussian-input',
+      'gal' => 'chemical/x-gaussian-log',
+      'gcg' => 'chemical/x-gcg8-sequence',
+      'gen' => 'chemical/x-genbank',
+      'hin' => 'chemical/x-hin',
+      'istr|ist' => 'chemical/x-isostar',
+      'jdx|dx' => 'chemical/x-jcamp-dx',
+      'kin' => 'chemical/x-kinemage',
+      'mcm' => 'chemical/x-macmolecule',
+      'mmd|mmod' => 'chemical/x-macromodel-input',
+      'mol' => 'chemical/x-mdl-molfile',
+      'rd' => 'chemical/x-mdl-rdfile',
+      'rxn' => 'chemical/x-mdl-rxnfile',
+      'sd|sdf' => 'chemical/x-mdl-sdfile',
+      'tgf' => 'chemical/x-mdl-tgf',
+      'mcif' => 'chemical/x-mmcif',
+      'mol2' => 'chemical/x-mol2',
+      'b' => 'chemical/x-molconn-Z',
+      'gpt' => 'chemical/x-mopac-graph',
+      'mop|mopcrt|mpc|dat|zmt' => 'chemical/x-mopac-input',
+      'moo' => 'chemical/x-mopac-out',
+      'mvb' => 'chemical/x-mopac-vib',
+      'asn' => 'chemical/x-ncbi-asn1-spec',
+      'prt|ent' => 'chemical/x-ncbi-asn1-ascii',
+      'val|aso' => 'chemical/x-ncbi-asn1-binary',
+      'pdb|ent' => 'chemical/x-pdb',
+      'ros' => 'chemical/x-rosdal',
+      'sw' => 'chemical/x-swissprot',
+      'vms' => 'chemical/x-vamas-iso14976',
+      'vmd' => 'chemical/x-vmd',
+      'xtel' => 'chemical/x-xtel',
+      'xyz' => 'chemical/x-xyz',
+      'gif' => 'image/gif',
+      'ief' => 'image/ief',
+      'jpeg|jpg|jpe' => 'image/jpeg',
+      'pcx' => 'image/pcx',
+      'png' => 'image/png',
+      'svg|svgz' => 'image/svg+xml',
+      'tiff|tif' => 'image/tiff',
+      'djvu|djv' => 'image/vnd.djvu',
+      'wbmp' => 'image/vnd.wap.wbmp',
+      'ras' => 'image/x-cmu-raster',
+      'cdr' => 'image/x-coreldraw',
+      'pat' => 'image/x-coreldrawpattern',
+      'cdt' => 'image/x-coreldrawtemplate',
+      'ico' => 'image/x-icon',
+      'art' => 'image/x-jg',
+      'jng' => 'image/x-jng',
+      'bmp' => 'image/x-ms-bmp',
+      'psd' => 'image/x-photoshop',
+      'pnm' => 'image/x-portable-anymap',
+      'pbm' => 'image/x-portable-bitmap',
+      'pgm' => 'image/x-portable-graymap',
+      'ppm' => 'image/x-portable-pixmap',
+      'rgb' => 'image/x-rgb',
+      'xbm' => 'image/x-xbitmap',
+      'xpm' => 'image/x-xpixmap',
+      'xwd' => 'image/x-xwindowdump',
+      'eml' => 'message/rfc822',
+      'igs|iges' => 'model/iges',
+      'msh|mesh|silo' => 'model/mesh',
+      'wrl|vrml' => 'model/vrml',
+      'ics|icz' => 'text/calendar',
+      'css' => 'text/css',
+      'csv' => 'text/csv',
+      '323' => 'text/h323',
+      'html|htm|shtml' => 'text/html',
+      'uls' => 'text/iuls',
+      'mml' => 'text/mathml',
+      'asc|txt|text|pot' => 'text/plain',
+      'rtx' => 'text/richtext',
+      'sct|wsc' => 'text/scriptlet',
+      'tm|ts' => 'text/texmacs',
+      'tsv' => 'text/tab-separated-values',
+      'jad' => 'text/vnd.sun.j2me.app-descriptor',
+      'wml' => 'text/vnd.wap.wml',
+      'wmls' => 'text/vnd.wap.wmlscript',
+      'bib' => 'text/x-bibtex',
+      'boo' => 'text/x-boo',
+      'h++|hpp|hxx|hh' => 'text/x-c++hdr',
+      'c++|cpp|cxx|cc' => 'text/x-c++src',
+      'h' => 'text/x-chdr',
+      'htc' => 'text/x-component',
+      'c' => 'text/x-csrc',
+      'd' => 'text/x-dsrc',
+      'diff|patch' => 'text/x-diff',
+      'hs' => 'text/x-haskell',
+      'java' => 'text/x-java',
+      'lhs' => 'text/x-literate-haskell',
+      'moc' => 'text/x-moc',
+      'p|pas' => 'text/x-pascal',
+      'gcd' => 'text/x-pcs-gcd',
+      'pl|pm' => 'text/x-perl',
+      'py' => 'text/x-python',
+      'etx' => 'text/x-setext',
+      'tcl|tk' => 'text/x-tcl',
+      'tex|ltx|sty|cls' => 'text/x-tex',
+      'vcs' => 'text/x-vcalendar',
+      'vcf' => 'text/x-vcard',
+      '3gp' => 'video/3gpp',
+      'dl' => 'video/dl',
+      'dif|dv' => 'video/dv',
+      'fli' => 'video/fli',
+      'gl' => 'video/gl',
+      'mpeg|mpg|mpe' => 'video/mpeg',
+      'mp4' => 'video/mp4',
+      'ogv' => 'video/ogg',
+      'qt|mov' => 'video/quicktime',
+      'mxu' => 'video/vnd.mpegurl',
+      'lsf|lsx' => 'video/x-la-asf',
+      'mng' => 'video/x-mng',
+      'asf|asx' => 'video/x-ms-asf',
+      'wm' => 'video/x-ms-wm',
+      'wmv' => 'video/x-ms-wmv',
+      'wmx' => 'video/x-ms-wmx',
+      'wvx' => 'video/x-ms-wvx',
+      'avi' => 'video/x-msvideo',
+      'movie' => 'video/x-sgi-movie',
+      'ice' => 'x-conference/x-cooltalk',
+      'sisx' => 'x-epoc/x-sisx-app',
+      'vrm|vrml|wrl' => 'x-world/x-vrml',
+      'xps' => 'application/vnd.ms-xpsdocument',
+    ),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function system_help($path, $arg) {
@@ -674,7 +1102,7 @@
  * Menu item access callback - only admin or enabled themes can be accessed.
  */
 function _system_themes_access($theme) {
-  return user_access('administer site configuration') && ($theme->status || $theme->name == variable_get('admin_theme', '0'));
+  return user_access('administer site configuration') && ($theme->status || $theme->name == variable_get('admin_theme'));
 }
 
 /**
@@ -682,9 +1110,9 @@
  */
 function system_init() {
   // Use the administrative theme if the user is looking at a page in the admin/* path.
-  if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
+  if (arg(0) == 'admin' || (variable_get('node_admin_theme') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
     global $custom_theme;
-    $custom_theme = variable_get('admin_theme', '0');
+    $custom_theme = variable_get('admin_theme');
     drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
   }
 
@@ -719,7 +1147,7 @@
   if ($type == 'form' && $category == 'account') {
     $form['theme_select'] = system_theme_select_form(t('Selecting a different theme will change the look and feel of the site.'), isset($edit['theme']) ? $edit['theme'] : NULL, 2);
 
-    if (variable_get('configurable_timezones', 1)) {
+    if (variable_get('configurable_timezones')) {
       $zones = _system_zonelist();
       $form['timezone'] = array(
         '#type' => 'fieldset',
@@ -730,7 +1158,7 @@
       $form['timezone']['timezone'] = array(
         '#type' => 'select',
         '#title' => t('Time zone'),
-        '#default_value' => strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0),
+        '#default_value' => strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone'),
         '#options' => $zones,
         '#description' => t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.'),
       );
@@ -760,13 +1188,13 @@
       $form['wrapper']['color'] = array(
         '#type' => 'select',
         '#title' => t('Badge color'),
-        '#default_value' => variable_get('drupal_badge_color', 'powered-blue'),
+        '#default_value' => variable_get('drupal_badge_color'),
         '#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')),
       );
       $form['wrapper']['size'] = array(
         '#type' => 'select',
         '#title' => t('Badge size'),
-        '#default_value' => variable_get('drupal_badge_size', '80x15'),
+        '#default_value' => variable_get('drupal_badge_size'),
         '#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')),
       );
       return $form;
@@ -775,7 +1203,7 @@
       variable_set('drupal_badge_size', $edit['size']);
       break;
     case 'view':
-      $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
+      $image_path = 'misc/' . variable_get('drupal_badge_color') . '-' . variable_get('drupal_badge_size') . '.png';
       $block['subject'] = NULL; // Don't display a title
       $block['content'] = theme('system_powered_by', $image_path);
       return $block;
@@ -821,7 +1249,7 @@
  */
 function system_admin_theme_submit($form, &$form_state) {
   // If we're changing themes, make sure the theme has its blocks initialized.
-  if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] != variable_get('admin_theme', '0')) {
+  if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] != variable_get('admin_theme')) {
     $result = db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $form_state['values']['admin_theme']));
     if (!$result) {
       system_initialize_theme_blocks($form_state['values']['admin_theme']);
@@ -865,7 +1293,7 @@
 
       foreach ($enabled as $info) {
         // For the default theme, revert to an empty string so the user's theme updates when the site theme is changed.
-        $info->key = $info->name == variable_get('theme_default', 'garland') ? '' : $info->name;
+        $info->key = $info->name == variable_get('theme_default') ? '' : $info->name;
 
         $screenshot = NULL;
         $theme_key = $info->name;
@@ -880,7 +1308,7 @@
         $screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
 
         $form['themes'][$info->key]['screenshot'] = array('#markup' => $screenshot);
-        $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#markup' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '<br /> <em>' . t('(site default theme)') . '</em>' : ''));
+        $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#markup' => dirname($info->filename) . ($info->name == variable_get('theme_default') ? '<br /> <em>' . t('(site default theme)') . '</em>' : ''));
         $options[$info->key] = '';
       }
 
@@ -1164,7 +1592,7 @@
 function system_initialize_theme_blocks($theme) {
   // Initialize theme's blocks if none already registered.
   if (!(db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $theme)))) {
-    $default_theme = variable_get('theme_default', 'garland');
+    $default_theme = variable_get('theme_default');
     $regions = system_region_list($theme);
     $result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $default_theme);
     while ($block = db_fetch_array($result)) {
@@ -1189,6 +1617,8 @@
  *   The form structure.
  */
 function system_settings_form($form) {
+  $form = _system_settings_form_variable_defaults($form);
+
   $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') );
   $form['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults') );
 
@@ -1201,6 +1631,32 @@
 }
 
 /**
+ * Helper function for system_settings_form() - fill in default values for
+ * variable derived form items recursively.
+ *
+ * @param $form
+ *   The form to fill in default values of.
+ * @return
+ *   The form with filled-in default values.
+ */
+function _system_settings_form_variable_defaults($form) {
+  foreach (element_children($form) as $child) {
+    if (isset($form[$child]['#type'])) {
+      $info = _element_info($form[$child]['#type']);
+      // Only add the default value if #variable is not FALSE and the form item
+      // is used for input and it doesn't already have a #value or a
+      // #default_value.
+      if (isset($info['#input']) && $info['#input'] && (!isset($form[$child]['#variable']) || !$form[$child]['#variable']) && !isset($form[$child]['#value']) && !isset($form[$child]['#default_value'])) {
+        $form[$child]['#default_value'] = variable_get($child);
+      }
+    }
+    // Recursively do this for all children.
+    $form[$child] = _system_settings_form_variable_defaults($form[$child]);
+  }
+  return $form;
+}
+
+/**
  * Execute the system_settings_form.
  *
  * If you want node type configure style handling of your checkboxes,
@@ -1257,7 +1713,7 @@
     $old = 'toggle_node_info_' . $info->old_type;
     $new = 'toggle_node_info_' . $info->type;
 
-    $theme_settings = variable_get('theme_settings', array());
+    $theme_settings = variable_get('theme_settings');
     if (isset($theme_settings[$old])) {
       $theme_settings[$new] = $theme_settings[$old];
       unset($theme_settings[$old]);
@@ -1331,7 +1787,7 @@
  */
 function system_admin_compact_mode() {
   global $user;
-  return (isset($user->admin_compact_mode)) ? $user->admin_compact_mode : variable_get('admin_compact_mode', FALSE);
+  return (isset($user->admin_compact_mode)) ? $user->admin_compact_mode : variable_get('admin_compact_mode');
 }
 
 /**
@@ -1888,7 +2344,7 @@
   $account = $params['account'];
   $context = $params['context'];
   $variables = array(
-    '%site_name' => variable_get('site_name', 'Drupal'),
+    '%site_name' => variable_get('site_name'),
     '%username' => $account->name,
   );
   if ($context['hook'] == 'taxonomy') {
@@ -1944,8 +2400,8 @@
 function system_message_action(&$object, $context = array()) {
   global $user;
   $variables = array(
-    '%site_name' => variable_get('site_name', 'Drupal'),
-    '%username' => $user->name ? $user->name : variable_get('anonymous', t('Anonymous')),
+    '%site_name' => variable_get('site_name'),
+    '%username' => $user->name ? $user->name : variable_get('anonymous'),
   );
 
   // This action can be called in any context, but if placeholders
@@ -2038,7 +2494,7 @@
   $zones = array();
   foreach ($zonelist as $offset) {
     $zone = $offset * 3600;
-    $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
+    $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long') . ' O', $zone);
   }
   return $zones;
 }
Index: modules/system/image.gd.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/image.gd.inc,v
retrieving revision 1.2
diff -u -r1.2 image.gd.inc
--- modules/system/image.gd.inc	16 Jul 2008 21:59:28 -0000	1.2
+++ modules/system/image.gd.inc	29 Sep 2008 22:13:57 -0000
@@ -34,7 +34,6 @@
       '#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
       '#size' => 10,
       '#maxlength' => 3,
-      '#default_value' => variable_get('image_jpeg_quality', 75),
       '#field_suffix' => t('%'),
     );
     $form['#element_validate'] = array('image_gd_settings_validate');
@@ -209,7 +208,7 @@
     return FALSE;
   }
   if ($extension == 'jpeg') {
-    return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
+    return $close_func($res, $destination, variable_get('image_jpeg_quality'));
   }
   else {
     return $close_func($res, $destination);
Index: modules/aggregator/aggregator.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v
retrieving revision 1.8
diff -u -r1.8 aggregator.test
--- modules/aggregator/aggregator.test	15 Sep 2008 21:06:06 -0000	1.8
+++ modules/aggregator/aggregator.test	29 Sep 2008 22:13:56 -0000
@@ -65,7 +65,7 @@
     $this->assertResponse(200, t('rss.xml is reachable.'));
 
     // Our tests are based off of rss.xml, so let's find out how many elements should be related.
-    $feed_count = db_result(db_query_range(db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE n.promote = 1 AND n.status = 1'), 0, variable_get('feed_default_items', 10)));
+    $feed_count = db_result(db_query_range(db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE n.promote = 1 AND n.status = 1'), 0, variable_get('feed_default_items')));
     $feed_count = $feed_count > 10 ? 10 : $feed_count;
 
     // Refresh the feed (simulated link click).
Index: modules/aggregator/aggregator.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v
retrieving revision 1.16
diff -u -r1.16 aggregator.admin.inc
--- modules/aggregator/aggregator.admin.inc	17 Sep 2008 07:11:56 -0000	1.16
+++ modules/aggregator/aggregator.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -398,24 +398,23 @@
 
   $form['aggregator_allowed_html_tags'] = array(
     '#type' => 'textfield', '#title' => t('Allowed HTML tags'), '#size' => 80, '#maxlength' => 255,
-    '#default_value' => variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'),
     '#description' => t('A space-separated list of HTML tags allowed in the content of feed items. (Tags in this list are not removed by Drupal.)'),
   );
 
   $form['aggregator_summary_items'] = array(
     '#type' => 'select', '#title' => t('Items shown in sources and categories pages') ,
-    '#default_value' => variable_get('aggregator_summary_items', 3), '#options' => $items,
+    '#options' => $items,
     '#description' => t('Number of feed items displayed in feed and category summary pages.'),
   );
 
   $form['aggregator_clear'] = array(
     '#type' => 'select', '#title' => t('Discard items older than'),
-    '#default_value' => variable_get('aggregator_clear', 9676800), '#options' => $period,
+    '#options' => $period,
     '#description' => t('The length of time to retain feed items before discarding. (Requires a correctly configured <a href="@cron">cron maintenance task</a>.)', array('@cron' => url('admin/reports/status'))),
   );
 
   $form['aggregator_category_selector'] = array(
-    '#type' => 'radios', '#title' => t('Category selection type'), '#default_value' => variable_get('aggregator_category_selector', 'checkboxes'),
+    '#type' => 'radios', '#title' => t('Category selection type'),
     '#options' => array('checkboxes' => t('checkboxes'), 'select' => t('multiple selector')),
     '#description' => t('The type of category selection widget displayed on categorization pages. (For a small number of categories, checkboxes are easier to use, while a multiple selector work well with large numbers of categories.)'),
   );
Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.392
diff -u -r1.392 aggregator.module
--- modules/aggregator/aggregator.module	17 Sep 2008 07:11:56 -0000	1.392
+++ modules/aggregator/aggregator.module	29 Sep 2008 22:13:56 -0000
@@ -7,6 +7,20 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function aggregator_variables() {
+  return array(
+    'aggregator_allowed_html_tags' => '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>',
+    'aggregator_summary_items' => 3,
+    'aggregator_clear' => 9676800,
+    'aggregator_category_selector' => 'checkboxes',
+    'feed_default_items' => 10,
+    'feed_item_length' => 'teaser',
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function aggregator_help($path, $arg) {
@@ -810,7 +824,7 @@
   }
 
   // Remove all items that are older than flush item timer.
-  $age = REQUEST_TIME - variable_get('aggregator_clear', 9676800);
+  $age = REQUEST_TIME - variable_get('aggregator_clear');
   $result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age);
 
   $items = array();
@@ -922,7 +936,7 @@
  *   The filtered content.
  */
 function aggregator_filter_xss($value) {
-  return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'), -1, PREG_SPLIT_NO_EMPTY));
+  return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags'), -1, PREG_SPLIT_NO_EMPTY));
 }
 
 /**
Index: modules/aggregator/aggregator.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v
retrieving revision 1.18
diff -u -r1.18 aggregator.pages.inc
--- modules/aggregator/aggregator.pages.inc	17 Sep 2008 07:11:56 -0000	1.18
+++ modules/aggregator/aggregator.pages.inc	29 Sep 2008 22:13:56 -0000
@@ -13,7 +13,7 @@
  *   The items HTML.
  */
 function aggregator_page_last() {
-  drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') . ' ' . t('aggregator'));
+  drupal_add_feed(url('aggregator/rss'), variable_get('site_name') . ' ' . t('aggregator'));
 
   $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC');
 
@@ -64,7 +64,7 @@
   // $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
   $category = is_array($arg2) ? $arg2 : $arg1;
 
-  drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
+  drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
 
   // It is safe to include the cid in the query because it's loaded from the
   // database by aggregator_category_load.
@@ -170,7 +170,7 @@
     }
     $done = TRUE;
     $form['categories'][$item->iid] = array(
-      '#type' => variable_get('aggregator_category_selector', 'checkboxes'),
+      '#type' => variable_get('aggregator_category_selector'),
       '#default_value' => $selected,
       '#options' => $categories,
       '#size' => 10,
@@ -268,7 +268,7 @@
     $variables['source_date'] = t('%ago ago', array('%ago' => format_interval(REQUEST_TIME - $item->timestamp)));
   }
   else {
-    $variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
+    $variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium'));
   }
 
   $variables['categories'] = array();
@@ -287,8 +287,8 @@
   while ($feed = db_fetch_object($result)) {
     // Most recent items:
     $summary_items = array();
-    if (variable_get('aggregator_summary_items', 3)) {
-      $items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = %d ORDER BY i.timestamp DESC', $feed->fid, 0, variable_get('aggregator_summary_items', 3));
+    if (variable_get('aggregator_summary_items')) {
+      $items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = %d ORDER BY i.timestamp DESC', $feed->fid, 0, variable_get('aggregator_summary_items'));
       while ($item = db_fetch_object($items)) {
         $summary_items[] = theme('aggregator_summary_item', $item);
       }
@@ -309,9 +309,9 @@
 
   $output = '';
   while ($category = db_fetch_object($result)) {
-    if (variable_get('aggregator_summary_items', 3)) {
+    if (variable_get('aggregator_summary_items')) {
       $summary_items = array();
-      $items = db_query_range('SELECT i.title, i.timestamp, i.link, f.title as feed_title, f.link as feed_link FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON i.iid = ci.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE ci.cid = %d ORDER BY i.timestamp DESC', $category->cid, 0, variable_get('aggregator_summary_items', 3));
+      $items = db_query_range('SELECT i.title, i.timestamp, i.link, f.title as feed_title, f.link as feed_link FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON i.iid = ci.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE ci.cid = %d ORDER BY i.timestamp DESC', $category->cid, 0, variable_get('aggregator_summary_items'));
       while ($item = db_fetch_object($items)) {
         $summary_items[] = theme('aggregator_summary_item', $item);
       }
@@ -332,13 +332,13 @@
   if (arg(2)) {
     $category = db_fetch_object(db_query('SELECT cid, title FROM {aggregator_category} WHERE cid = %d', arg(2)));
     $sql = 'SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = %d ORDER BY timestamp DESC, i.iid DESC';
-    $result = db_query_range($sql, $category->cid, 0, variable_get('feed_default_items', 10));
+    $result = db_query_range($sql, $category->cid, 0, variable_get('feed_default_items'));
   }
   // Or, get the default aggregator items.
   else {
     $category = NULL;
     $sql = 'SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC';
-    $result = db_query_range($sql, 0, variable_get('feed_default_items', 10));
+    $result = db_query_range($sql, 0, variable_get('feed_default_items'));
   }
 
   $feeds = array();
@@ -362,7 +362,7 @@
   drupal_set_header('Content-Type: application/rss+xml; charset=utf-8');
 
   $items = '';
-  $feed_length = variable_get('feed_item_length', 'teaser');
+  $feed_length = variable_get('feed_item_length');
   foreach ($feeds as $feed) {
     switch ($feed_length) {
       case 'teaser':
@@ -379,7 +379,7 @@
     $items .= format_rss_item($feed->ftitle . ': ' . $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp)));
   }
 
-  $site_name = variable_get('site_name', 'Drupal');
+  $site_name = variable_get('site_name');
   $url = url((isset($category) ? 'aggregator/categories/' . $category->cid : 'aggregator'), array('absolute' => TRUE));
   $description = isset($category) ? t('@site_name - aggregated feeds in category @title', array('@site_name' => $site_name, '@title' => $category->title)) : t('@site_name - aggregated feeds', array('@site_name' => $site_name));
 
@@ -428,7 +428,7 @@
   $output  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
   $output .= "<opml version=\"1.1\">\n";
   $output .= "<head>\n";
-  $output .= '<title>' . check_plain(variable_get('site_name', 'Drupal')) . "</title>\n";
+  $output .= '<title>' . check_plain(variable_get('site_name')) . "</title>\n";
   $output .= '<dateModified>' . gmdate('r') . "</dateModified>\n";
   $output .= "</head>\n";
   $output .= "<body>\n";
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.17
diff -u -r1.17 aggregator.install
--- modules/aggregator/aggregator.install	12 Aug 2008 07:00:48 -0000	1.17
+++ modules/aggregator/aggregator.install	29 Sep 2008 22:13:56 -0000
@@ -15,11 +15,6 @@
 function aggregator_uninstall() {
   // Remove tables.
   drupal_uninstall_schema('aggregator');
-
-  variable_del('aggregator_allowed_html_tags');
-  variable_del('aggregator_summary_items');
-  variable_del('aggregator_clear');
-  variable_del('aggregator_category_selector');
 }
 
 /**
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.260
diff -u -r1.260 update.php
--- update.php	20 Sep 2008 20:22:23 -0000	1.260
+++ update.php	29 Sep 2008 22:13:55 -0000
@@ -534,7 +534,7 @@
 function update_fix_d6_requirements() {
   $ret = array();
 
-  if (drupal_get_installed_schema_version('system') < 6000 && !variable_get('update_d6_requirements', FALSE)) {
+  if (drupal_get_installed_schema_version('system') < 6000 && !variable_get('update_d6_requirements')) {
     $spec = array('type' => 'int', 'size' => 'small', 'default' => 0, 'not null' => TRUE);
     db_add_field($ret, 'cache', 'serialized', $spec);
     db_add_field($ret, 'cache_filter', 'serialized', $spec);
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.133
diff -u -r1.133 install.php
--- install.php	20 Sep 2008 20:22:23 -0000	1.133
+++ install.php	29 Sep 2008 22:13:55 -0000
@@ -641,7 +641,7 @@
 
   // Install profile modules.
   if ($task == 'profile-install') {
-    $modules = variable_get('install_profile_modules', array());
+    $modules = variable_get('install_profile_modules');
     $files = module_rebuild_cache();
     variable_del('install_profile_modules');
     $operations = array();
@@ -697,7 +697,8 @@
   }
 
   if ($task == 'configure') {
-    if (variable_get('site_name', FALSE) || variable_get('site_mail', FALSE)) {
+    global $conf;
+    if (isset($conf['site_name']) || isset($conf['site_mail'])) {
       // Site already configured: This should never happen, means re-running
       // the installer, possibly by an attacker after the 'install_task' variable
       // got accidentally blown somewhere. Stop it now.
@@ -705,7 +706,7 @@
     }
     $form = drupal_get_form('install_configure_form', $url);
 
-    if (!variable_get('site_name', FALSE) && !variable_get('site_mail', FALSE)) {
+    if (!isset($conf['site_name']) && !isset($conf['site_mail'])) {
       // Not submitted yet: Prepare to display the form.
       $output = $form;
       drupal_set_title(st('Configure site'));
@@ -779,7 +780,7 @@
       include_once DRUPAL_ROOT . '/includes/locale.inc';
       // Collect files to import for this language. Skip components
       // already covered in the initial batch set.
-      $batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components', array()));
+      $batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components'));
       // Remove temporary variable.
       variable_del('install_locale_batch_components');
       if (!empty($batch)) {
Index: cron.php
===================================================================
RCS file: /cvs/drupal/drupal/cron.php,v
retrieving revision 1.40
diff -u -r1.40 cron.php
--- cron.php	20 Sep 2008 20:22:23 -0000	1.40
+++ cron.php	29 Sep 2008 22:13:55 -0000
@@ -13,7 +13,7 @@
 
 include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-if (isset($_GET['cron_key']) && variable_get('cron_key', 'drupal') == $_GET['cron_key']) {
+if (isset($_GET['cron_key']) && variable_get('cron_key') == $_GET['cron_key']) {
   drupal_cron_run();
 }
 else {
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.469
diff -u -r1.469 book.module
--- modules/book/book.module	27 Sep 2008 20:37:00 -0000	1.469
+++ modules/book/book.module	29 Sep 2008 22:13:56 -0000
@@ -5,6 +5,17 @@
  * @file
  * Allows users to structure the pages of a site in a hierarchy or outline.
  */
+ 
+/**
+ * Implementation of hook_variables().
+ */
+function book_variables() {
+  return array(
+    'book_allowed_types' => array('book'),
+    'book_child_type' => 'book',
+    'book_block_mode' => 'all pages',
+  );
+}
 
 /**
  * Implementation of hook_theme().
@@ -56,7 +67,7 @@
 
   if ($type == 'node' && isset($node->book)) {
     if (!$teaser) {
-      $child_type = variable_get('book_child_type', 'book');
+      $child_type = variable_get('book_child_type');
       if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) {
         $links['book_add_child'] = array(
           'title' => t('Add child page'),
@@ -188,7 +199,7 @@
         $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
       }
 
-      if (variable_get('book_block_mode', 'all pages') == 'all pages') {
+      if (variable_get('book_block_mode') == 'all pages') {
         $block['subject'] = t('Book navigation');
         $book_menus = array();
         $pseudo_tree = array(0 => array('below' => FALSE));
@@ -232,7 +243,7 @@
         '#type' => 'radios',
         '#title' => t('Book navigation block display'),
         '#options' => $options,
-        '#default_value' => variable_get('book_block_mode', 'all pages'),
+        '#default_value' => variable_get('book_block_mode'),
         '#description' => t("If <em>Show block on all pages</em> is selected, the block will contain the automatically generated menus for all of the site's books. If <em>Show block only on book pages</em> is selected, the block will contain only the one menu corresponding to the current page's book. In this case, if the current page is not in a book, no block will be displayed. The <em>Page specific visibility settings</em> or other visibility settings can be used in addition to selectively display this block."),
         );
 
@@ -332,7 +343,7 @@
  * form element.
  */
 function _book_parent_select($book_link) {
-  if (variable_get('menu_override_parent_selector', FALSE)) {
+  if (variable_get('menu_override_parent_selector')) {
     return array();
   }
   // Offer a message or a drop-down to choose a different parent page.
@@ -999,7 +1010,7 @@
  * Determine if a given node type is in the list of types allowed for books.
  */
 function book_type_is_allowed($type) {
-  return in_array($type, variable_get('book_allowed_types', array('book')));
+  return in_array($type, variable_get('book_allowed_types'));
 }
 
 /**
@@ -1013,7 +1024,7 @@
     case 'update':
       if (!empty($type->old_type) && $type->old_type != $type->type) {
         // Update the list of node types that are allowed to be added to books.
-        $allowed_types = variable_get('book_allowed_types', array('book'));
+        $allowed_types = variable_get('book_allowed_types');
         $key = array_search($type->old_type, $allowed_types);
 
         if ($key !== FALSE) {
@@ -1023,7 +1034,7 @@
         }
 
         // Update the setting for the "Add child page" link.
-        if (variable_get('book_child_type', 'book') == $type->old_type) {
+        if (variable_get('book_child_type') == $type->old_type) {
           variable_set('book_child_type', $type->type);
         }
       }
Index: modules/book/book.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v
retrieving revision 1.12
diff -u -r1.12 book.admin.inc
--- modules/book/book.admin.inc	5 Jul 2008 06:00:51 -0000	1.12
+++ modules/book/book.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -31,7 +31,6 @@
   $form['book_allowed_types'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Allowed book outline types'),
-    '#default_value' => variable_get('book_allowed_types', array('book')),
     '#options' => $types,
     '#description' => t('Select content types which users with the %add-perm permission will be allowed to add to the book hierarchy. Users with the %outline-perm permission can add all content types.', array('%add-perm' => t('add content to books'),  '%outline-perm' => t('administer book outlines'))),
     '#required' => TRUE,
@@ -39,7 +38,6 @@
   $form['book_child_type'] = array(
     '#type' => 'radios',
     '#title' => t('Default child page type'),
-    '#default_value' => variable_get('book_child_type', 'book'),
     '#options' => $types,
     '#description' => t('The content type for the %add-child link must be one of those selected as an allowed book outline type.', array('%add-child' => t('Add child page'))),
     '#required' => TRUE,
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.39
diff -u -r1.39 node.pages.inc
--- modules/node/node.pages.inc	27 Sep 2008 20:37:00 -0000	1.39
+++ modules/node/node.pages.inc	29 Sep 2008 22:13:56 -0000
@@ -72,7 +72,7 @@
 
 function node_object_prepare(&$node) {
   // Set up default values, if required.
-  $node_options = variable_get('node_options_' . $node->type, array('status', 'promote'));
+  $node_options = variable_get('node_options_' . $node->type, array('status'));
   // If this is a new node, fill in the default values.
   if (!isset($node->nid)) {
     foreach (array('status', 'promote', 'sticky') as $key) {
@@ -186,7 +186,7 @@
     '#autocomplete_path' => 'user/autocomplete',
     '#default_value' => $node->name ? $node->name : '',
     '#weight' => -1,
-    '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
+    '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous'))),
   );
   $form['author']['date'] = array(
     '#type' => 'textfield',
Index: modules/node/node.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v
retrieving revision 1.26
diff -u -r1.26 node.admin.inc
--- modules/node/node.admin.inc	15 Sep 2008 20:48:08 -0000	1.26
+++ modules/node/node.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -29,12 +29,12 @@
   }
 
   $form['default_nodes_main'] = array(
-    '#type' => 'select', '#title' => t('Number of posts on main page'), '#default_value' => variable_get('default_nodes_main', 10),
+    '#type' => 'select', '#title' => t('Number of posts on main page'),
     '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)),
     '#description' => t('The default maximum number of posts to display per page on overview pages such as the main page.')
   );
   $form['teaser_length'] = array(
-    '#type' => 'select', '#title' => t('Length of trimmed posts'), '#default_value' => variable_get('teaser_length', 600),
+    '#type' => 'select', '#title' => t('Length of trimmed posts'),
     '#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_node_characters'),
     '#description' => t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited' . Note that this setting will only affect new or updated content and will not affect existing teasers.")
   );
@@ -42,7 +42,6 @@
   $form['node_preview'] = array(
     '#type' => 'radios',
     '#title' => t('Preview post'),
-    '#default_value' => variable_get('node_preview', 0),
     '#options' => array(t('Optional'), t('Required')),
     '#description' => t('Must users preview posts before submitting?'),
   );
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.978
diff -u -r1.978 node.module
--- modules/node/node.module	27 Sep 2008 19:47:43 -0000	1.978
+++ modules/node/node.module	29 Sep 2008 22:13:56 -0000
@@ -46,6 +46,20 @@
 define('NODE_BUILD_PRINT', 5);
 
 /**
+ * Implementation of hook_variables().
+ */
+function node_variables() {
+  return array(
+    'node_options' => array('status', 'promote'),
+    'node_cron_last' => 0,
+    'default_nodes_main' => 10,
+    'teaser_length' => 600,
+    'node_preview' => 0,
+    'node_access_needs_rebuild' => FALSE,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function node_help($path, $arg) {
@@ -330,7 +344,7 @@
 function node_teaser($body, $format = NULL, $size = NULL) {
 
   if (!isset($size)) {
-    $size = variable_get('teaser_length', 600);
+    $size = variable_get('teaser_length');
   }
 
   // Find where the delimiter is in the body
@@ -1248,7 +1262,6 @@
           '#title' => $values['title'],
           '#type' => 'select',
           '#options' => $options,
-          '#default_value' => variable_get('node_rank_'. $var, 0),
         );
       }
       return $form;
@@ -1367,7 +1380,7 @@
   );
 
   // Add relevance based on creation or changed date.
-  if ($node_cron_last = variable_get('node_cron_last', 0)) {
+  if ($node_cron_last = variable_get('node_cron_last')) {
     $ranking['recent'] = array(
       'title' => t('Recently posted'),
       // Exponential decay with half-life of 6 months, starting at last indexed node
@@ -1712,13 +1725,13 @@
 
   if ($nids === FALSE) {
     $nids = array();
-    $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10));
+    $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items'));
     while ($row = db_fetch_object($result)) {
       $nids[] = $row->nid;
     }
   }
 
-  $item_length = variable_get('feed_item_length', 'teaser');
+  $item_length = variable_get('feed_item_length');
   $namespaces = array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/');
 
   $items = '';
@@ -1773,9 +1786,9 @@
 
   $channel_defaults = array(
     'version'     => '2.0',
-    'title'       => variable_get('site_name', 'Drupal'),
+    'title'       => variable_get('site_name'),
     'link'        => $base_url,
-    'description' => variable_get('site_mission', ''),
+    'description' => variable_get('site_mission'),
     'language'    => $language->language
   );
   $channel = array_merge($channel_defaults, $channel);
@@ -1793,7 +1806,7 @@
  * Menu callback; Generate a listing of promoted nodes.
  */
 function node_page_default() {
-  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
+  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main'));
 
   $output = '';
   $num_rows = FALSE;
@@ -1804,8 +1817,8 @@
 
   if ($num_rows) {
     $feed_url = url('rss.xml', array('absolute' => TRUE));
-    drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') . ' ' . t('RSS'));
-    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+    drupal_add_feed($feed_url, variable_get('site_name') . ' ' . t('RSS'));
+    $output .= theme('pager', NULL, variable_get('default_nodes_main'));
   }
   else {
     $default_message = '<h1 class="title">' . t('Welcome to your new Drupal website!') . '</h1>';
@@ -1837,7 +1850,7 @@
  * Implementation of hook_update_index().
  */
 function node_update_index() {
-  $limit = (int)variable_get('search_cron_limit', 100);
+  $limit = (int)variable_get('search_cron_limit');
 
   // Store the maximum possible comments per thread (used for ranking by reply count)
   variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'))));
@@ -2367,7 +2380,7 @@
  */
 function node_access_needs_rebuild($rebuild = NULL) {
   if (!isset($rebuild)) {
-    return variable_get('node_access_needs_rebuild', FALSE);
+    return variable_get('node_access_needs_rebuild');
   }
   elseif ($rebuild) {
     variable_set('node_access_needs_rebuild', TRUE);
Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.57
diff -u -r1.57 content_types.inc
--- modules/node/content_types.inc	16 Jul 2008 21:59:27 -0000	1.57
+++ modules/node/content_types.inc	29 Sep 2008 22:13:56 -0000
@@ -152,7 +152,7 @@
   );
   $form['workflow']['node_options'] = array('#type' => 'checkboxes',
     '#title' => t('Default options'),
-    '#default_value' => variable_get('node_options_' . $type->type, array('status', 'promote')),
+    '#default_value' => variable_get('node_options_' . $type->type),
     '#options' => array(
       'status' => t('Published'),
       'promote' => t('Promoted to front page'),
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.223
diff -u -r1.223 locale.module
--- modules/locale/locale.module	20 Sep 2008 20:22:24 -0000	1.223
+++ modules/locale/locale.module	29 Sep 2008 22:13:56 -0000
@@ -22,9 +22,14 @@
  */
 define('LANGUAGE_RTL', 1);
 
-
-// ---------------------------------------------------------------------------------
-// Hook implementations
+/**
+ * Implementation of hook_variables().
+ */
+function locale_variables() {
+  return array(
+    'locale_cache_strings' => 1,
+  );
+}
 
 /**
  * Implementation of hook_help().
@@ -219,7 +224,7 @@
 
   // If we have more then one language and either creating a user on the
   // admin interface or edit the user, show the language selector.
-  if (variable_get('language_count', 1) > 1 && ($type == 'register' && user_access('administer users') || $type == 'form' && $category == 'account' )) {
+  if (variable_get('language_count') > 1 && ($type == 'register' && user_access('administer users') || $type == 'form' && $category == 'account' )) {
     $languages = language_list('enabled');
     $languages = $languages[1];
 
@@ -238,7 +243,7 @@
     );
 
     // Get language negotiation settings.
-    $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
+    $mode = variable_get('language_negotiation');
     $form['locale']['language'] = array(
       '#type' => (count($names) <= 5 ? 'radios' : 'select'),
       '#title' => t('Language'),
@@ -355,7 +360,7 @@
     // the exact list of strings used on a page. From a performance
     // perspective that is a really bad idea, so we have no user
     // interface for this. Be careful when turning this option off!
-    if (variable_get('locale_cache_strings', 1) == 1) {
+    if (variable_get('locale_cache_strings') == 1) {
       if ($cache = cache_get('locale:' . $langcode, 'cache')) {
         $locale_t[$langcode] = $cache->data;
       }
@@ -501,8 +506,8 @@
 function locale_update_js_files() {
   global $language;
 
-  $dir = file_create_path(variable_get('locale_js_directory', 'languages'));
-  $parsed = variable_get('javascript_parsed', array());
+  $dir = file_create_path(variable_get('locale_js_directory'));
+  $parsed = variable_get('javascript_parsed');
 
   // The first three parameters are NULL in order to get an array with all
   // scopes. This is necessary to prevent recreation of JS translation files
@@ -575,7 +580,7 @@
 
   // Only show if we have at least two languages and language dependent
   // web addresses, so we can actually link to other language versions.
-  elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) {
+  elseif ($op == 'view' && variable_get('language_count') > 1 && variable_get('language_negotiation') != LANGUAGE_NEGOTIATION_NONE) {
     $languages = language_list('enabled');
     $links = array();
     foreach ($languages[1] as $language) {
Index: modules/update/update.report.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.report.inc,v
retrieving revision 1.15
diff -u -r1.15 update.report.inc
--- modules/update/update.report.inc	17 Sep 2008 07:11:59 -0000	1.15
+++ modules/update/update.report.inc	29 Sep 2008 22:13:57 -0000
@@ -26,7 +26,7 @@
  * @ingroup themeable
  */
 function theme_update_report($data) {
-  $last = variable_get('update_last_check', 0);
+  $last = variable_get('update_last_check');
   $output = '<div class="update checked">' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(REQUEST_TIME - $last))) : t('Last checked: never'));
   $output .= ' <span class="check-manually">(' . l(t('Check manually'), 'admin/reports/updates/check') . ')</span>';
   $output .= "</div>\n";
@@ -39,7 +39,7 @@
   $header = array();
   $rows = array();
 
-  $notification_level = variable_get('update_notification_threshold', 'all');
+  $notification_level = variable_get('update_notification_threshold');
 
   foreach ($data as $project) {
     switch ($project['status']) {
Index: modules/update/update.fetch.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.fetch.inc,v
retrieving revision 1.12
diff -u -r1.12 update.fetch.inc
--- modules/update/update.fetch.inc	20 Sep 2008 20:22:25 -0000	1.12
+++ modules/update/update.fetch.inc	29 Sep 2008 22:13:57 -0000
@@ -51,7 +51,7 @@
     $available = $parser->parse($data);
   }
   if (!empty($available) && is_array($available)) {
-    $frequency = variable_get('update_check_frequency', 1);
+    $frequency = variable_get('update_check_frequency');
     cache_set('update_info', $available, 'cache_update', REQUEST_TIME + (60 * 60 * 24 * $frequency));
     variable_set('update_last_check', REQUEST_TIME);
     watchdog('update', 'Fetched information about all available new releases and updates.', array(), WATCHDOG_NOTICE, l(t('view'), 'admin/reports/updates'));
@@ -79,7 +79,7 @@
  * @see update_get_projects()
  */
 function _update_build_fetch_url($project, $site_key = '') {
-  $default_url = variable_get('update_fetch_url', UPDATE_DEFAULT_URL);
+  $default_url = variable_get('update_fetch_url');
   if (!isset($project['info']['project status url'])) {
     $project['info']['project status url'] = $default_url;
   }
@@ -119,7 +119,7 @@
     }
   }
   if (!empty($params)) {
-    $notify_list = variable_get('update_notify_emails', '');
+    $notify_list = variable_get('update_notify_emails');
     if (!empty($notify_list)) {
       $default_language = language_default();
       foreach ($notify_list as $target) {
Index: modules/update/update.settings.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.settings.inc,v
retrieving revision 1.3
diff -u -r1.3 update.settings.inc
--- modules/update/update.settings.inc	20 Oct 2007 21:57:50 -0000	1.3
+++ modules/update/update.settings.inc	29 Sep 2008 22:13:57 -0000
@@ -12,7 +12,7 @@
 function update_settings() {
   $form = array();
 
-  $notify_emails = variable_get('update_notify_emails', array());
+  $notify_emails = variable_get('update_notify_emails'));
   $form['update_notify_emails'] = array(
     '#type' => 'textarea',
     '#title' => t('E-mail addresses to notify when updates are available'),
@@ -24,7 +24,6 @@
   $form['update_check_frequency'] = array(
     '#type' => 'radios',
     '#title' => t('Check for updates'),
-    '#default_value' => variable_get('update_check_frequency', 1),
     '#options' => array(
       '1' => t('Daily'),
       '7' => t('Weekly'),
@@ -35,7 +34,6 @@
   $form['update_notification_threshold'] = array(
     '#type' => 'radios',
     '#title' => t('Notification threshold'),
-    '#default_value' => variable_get('update_notification_threshold', 'all'),
     '#options' => array(
       'all' => t('All newer versions'),
       'security' => t('Only security updates'),
Index: modules/update/update.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.module,v
retrieving revision 1.26
diff -u -r1.26 update.module
--- modules/update/update.module	23 Sep 2008 19:07:58 -0000	1.26
+++ modules/update/update.module	29 Sep 2008 22:13:57 -0000
@@ -51,6 +51,18 @@
  */
 define('UPDATE_UNKNOWN', -2);
 
+/**
+ * Implementation of hook_variables().
+ */
+function update_variables() {
+  return array(
+    'update_check_frequency' => 1,
+    'update_fetch_url' => UPDATE_DEFAULT_URL,
+    'update_notify_emails' => array(),
+    'update_notification_threshold' => 'all',
+    'update_last_check' => 0,
+  );
+}
 
 /**
  * Implementation of hook_help().
@@ -253,7 +265,7 @@
       break;
     case UPDATE_NOT_CURRENT:
       $requirement_label = t('Out of date');
-      $requirement['severity'] = variable_get('update_notification_threshold', 'all') == 'all' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
+      $requirement['severity'] = variable_get('update_notification_threshold') == 'all' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
       break;
     case UPDATE_UNKNOWN:
     case UPDATE_NOT_CHECKED:
@@ -274,11 +286,11 @@
  * Implementation of hook_cron().
  */
 function update_cron() {
-  $frequency = variable_get('update_check_frequency', 1);
+  $frequency = variable_get('update_check_frequency');
   $interval = 60 * 60 * 24 * $frequency;
   // Cron should check for updates if there is no update data cached or if the configured
   // update interval has elapsed.
-  if (!cache_get('update_info', 'cache_update') || ((REQUEST_TIME - variable_get('update_last_check', 0)) > $interval)) {
+  if (!cache_get('update_info', 'cache_update') || ((REQUEST_TIME - variable_get('update_last_check')) > $interval)) {
     update_refresh();
     _update_cron_notify();
   }
@@ -335,7 +347,7 @@
   // First, make sure that none of the .info files have a change time
   // newer than the last time we checked for available updates.
   $needs_refresh = FALSE;
-  $last_check = variable_get('update_last_check', 0);
+  $last_check = variable_get('update_last_check');
   $projects = update_get_projects();
   foreach ($projects as $key => $project) {
     if ($project['info']['_info_file_ctime'] > $last_check) {
@@ -404,7 +416,7 @@
 function update_mail($key, &$message, $params) {
   $language = $message['language'];
   $langcode = $language->language;
-  $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => variable_get('site_name', 'Drupal')), $langcode);
+  $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => variable_get('site_name')), $langcode);
   foreach ($params as $msg_type => $msg_reason) {
     $message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $language);
   }
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.207
diff -u -r1.207 upload.module
--- modules/upload/upload.module	27 Sep 2008 20:37:01 -0000	1.207
+++ modules/upload/upload.module	29 Sep 2008 22:13:57 -0000
@@ -8,6 +8,20 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function upload_variables() {
+  return array(
+    'upload_max_resolution' => 0,
+    'upload_list_default' => 1,
+    'upload_extensions' => 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp',
+    'upload_uploadsize' => 1,
+    'upload_usersize' => 1,
+    'upload' => 1,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function upload_help($path, $arg) {
@@ -120,18 +134,18 @@
  *       A string specifying the maximum resolution of images.
  */
 function _upload_file_limits($user) {
-  $file_limit = variable_get('upload_uploadsize_default', 1);
-  $user_limit = variable_get('upload_usersize_default', 1);
-  $all_extensions = explode(' ', variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'));
+  $file_limit = variable_get('upload_uploadsize');
+  $user_limit = variable_get('upload_usersize');
+  $all_extensions = explode(' ', variable_get('upload_extensions'));
   foreach ($user->roles as $rid => $name) {
-    $extensions = variable_get("upload_extensions_$rid", variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'));
+    $extensions = variable_get("upload_extensions_$rid");
     $all_extensions = array_merge($all_extensions, explode(' ', $extensions));
 
     // A zero value indicates no limit, take the least restrictive limit.
-    $file_size = variable_get("upload_uploadsize_$rid", variable_get('upload_uploadsize_default', 1)) * 1024 * 1024;
+    $file_size = variable_get("upload_uploadsize_$rid") * 1024 * 1024;
     $file_limit = ($file_limit && $file_size) ? max($file_limit, $file_size) : 0;
 
-    $user_size = variable_get("upload_usersize_$rid", variable_get('upload_usersize_default', 1)) * 1024 * 1024;
+    $user_size = variable_get("upload_usersize_$rid") * 1024 * 1024;
     $user_limit = ($user_limit && $user_size) ? max($user_limit, $user_size) : 0;
   }
   $all_extensions = implode(' ', array_unique($all_extensions));
@@ -139,7 +153,7 @@
     'extensions' => $all_extensions,
     'file_size' => $file_limit,
     'user_size' => $user_limit,
-    'resolution' => variable_get('upload_max_resolution', 0),
+    'resolution' => variable_get('upload_max_resolution'),
   );
 }
 
@@ -179,7 +193,7 @@
 
   // Save new file uploads.
   if (($user->uid != 1 || user_access('upload files')) && ($file = file_save_upload('upload', $validators, file_directory_path()))) {
-    $file->list = variable_get('upload_list_default', 1);
+    $file->list = variable_get('upload_list_default');
     $file->description = $file->filename;
     $file->weight = 0;
     $_SESSION['upload_files'][$file->fid] = $file;
@@ -212,14 +226,14 @@
     $form['workflow']['upload'] = array(
       '#type' => 'radios',
       '#title' => t('Attachments'),
-      '#default_value' => variable_get('upload_' . $form['#node_type']->type, 1),
+      '#default_value' => variable_get('upload_' . $form['#node_type']->type),
       '#options' => array(t('Disabled'), t('Enabled')),
     );
   }
 
   if (!empty($form['#node_edit_form'])) {
     $node = $form['#node'];
-    if (variable_get("upload_$node->type", TRUE)) {
+    if (variable_get("upload_$node->type")) {
       // Attachments fieldset
       $form['attachments'] = array(
         '#type' => 'fieldset',
@@ -270,7 +284,7 @@
 
     case 'load':
       $output = '';
-      if (variable_get("upload_$node->type", 1) == 1) {
+      if (variable_get("upload_$node->type") == 1) {
         $output['files'] = upload_load($node);
         return $output;
       }
Index: modules/upload/upload.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.admin.inc,v
retrieving revision 1.10
diff -u -r1.10 upload.admin.inc
--- modules/upload/upload.admin.inc	16 Jul 2008 21:59:28 -0000	1.10
+++ modules/upload/upload.admin.inc	29 Sep 2008 22:13:57 -0000
@@ -11,24 +11,24 @@
     }
   }
 
-  $default_uploadsize = $form_state['values']['upload_uploadsize_default'];
-  $default_usersize = $form_state['values']['upload_usersize_default'];
+  $default_uploadsize = $form_state['values']['upload_uploadsize'];
+  $default_usersize = $form_state['values']['upload_usersize'];
 
   $exceed_max_msg = t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) . '<br/>';
   $more_info = t("Depending on your server environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.");
 
   if (!is_numeric($default_uploadsize) || ($default_uploadsize <= 0)) {
-    form_set_error('upload_uploadsize_default', t('The %role file size limit must be a number and greater than zero.', array('%role' => t('default'))));
+    form_set_error('upload_uploadsize', t('The %role file size limit must be a number and greater than zero.', array('%role' => t('default'))));
   }
   if (!is_numeric($default_usersize) || ($default_usersize < 0)) {
-    form_set_error('upload_usersize_default', t('The %role file size limit must be a number zero or greater.', array('%role' => t('default'))));
+    form_set_error('upload_usersize', t('The %role file size limit must be a number zero or greater.', array('%role' => t('default'))));
   }
   if ($default_uploadsize * 1024 * 1024 > file_upload_max_size()) {
-    form_set_error('upload_uploadsize_default', $exceed_max_msg . $more_info);
+    form_set_error('upload_uploadsize', $exceed_max_msg . $more_info);
     $more_info = '';
   }
   if ($default_usersize && $default_uploadsize > $default_usersize) {
-    form_set_error('upload_uploadsize_default', t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => t('default'))));
+    form_set_error('upload_uploadsize', t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => t('default'))));
   }
 
   foreach ($form_state['values']['roles'] as $rid => $role) {
@@ -55,10 +55,6 @@
  * Menu callback for the upload settings form.
  */
 function upload_admin_settings() {
-  $upload_extensions_default = variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp');
-  $upload_uploadsize_default = variable_get('upload_uploadsize_default', 1);
-  $upload_usersize_default = variable_get('upload_usersize_default', 1);
-
   $form['settings_general'] = array(
     '#type' => 'fieldset',
     '#title' => t('General settings'),
@@ -67,7 +63,6 @@
   $form['settings_general']['upload_max_resolution'] = array(
     '#type' => 'textfield',
     '#title' => t('Maximum resolution for uploaded images'),
-    '#default_value' => variable_get('upload_max_resolution', 0),
     '#size' => 15,
     '#maxlength' => 10,
     '#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an <a href="!image-toolkit-link">image toolkit</a> is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
@@ -76,31 +71,27 @@
   $form['settings_general']['upload_list_default'] = array(
     '#type' => 'select',
     '#title' => t('List files by default'),
-    '#default_value' => variable_get('upload_list_default', 1),
     '#options' => array(0 => t('No'), 1 => t('Yes')),
     '#description' => t('Display attached files when viewing a post.'),
   );
 
-  $form['settings_general']['upload_extensions_default'] = array(
+  $form['settings_general']['upload_extensions'] = array(
     '#type' => 'textfield',
     '#title' => t('Default permitted file extensions'),
-    '#default_value' => $upload_extensions_default,
     '#maxlength' => 255,
     '#description' => t('Default extensions that users can upload. Separate extensions with a space and do not include the leading dot.'),
   );
-  $form['settings_general']['upload_uploadsize_default'] = array(
+  $form['settings_general']['upload_uploadsize'] = array(
     '#type' => 'textfield',
     '#title' => t('Default maximum file size per upload'),
-    '#default_value' => $upload_uploadsize_default,
     '#size' => 5,
     '#maxlength' => 5,
     '#description' => t('The default maximum file size a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
     '#field_suffix' => t('MB'),
   );
-  $form['settings_general']['upload_usersize_default'] = array(
+  $form['settings_general']['upload_usersize'] = array(
     '#type' => 'textfield',
     '#title' => t('Default total file size per user'),
-    '#default_value' => $upload_usersize_default,
     '#size' => 7,
     '#maxlength' => 7,
     '#description' => t('The default maximum size of all files a user can have on the site. Set to 0 for no restriction. The least restrictive limit is used, so setting this to 0 will disable any role-specific total file size limits.'),
@@ -122,14 +113,12 @@
     $form['settings_role_' . $rid]['upload_extensions_' . $rid] = array(
       '#type' => 'textfield',
       '#title' => t('Permitted file extensions'),
-      '#default_value' => variable_get('upload_extensions_' . $rid, $upload_extensions_default),
       '#maxlength' => 255,
       '#description' => t('Extensions that users in this role can upload. Separate extensions with a space and do not include the leading dot.'),
     );
     $form['settings_role_' . $rid]['upload_uploadsize_' . $rid] = array(
       '#type' => 'textfield',
       '#title' => t('Maximum file size per upload'),
-      '#default_value' => variable_get('upload_uploadsize_' . $rid, $upload_uploadsize_default),
       '#size' => 5,
       '#maxlength' => 5,
       '#description' => t('The maximum size of a file a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
@@ -138,7 +127,6 @@
     $form['settings_role_' . $rid]['upload_usersize_' . $rid] = array(
       '#type' => 'textfield',
       '#title' => t('Total file size per user'),
-      '#default_value' => variable_get('upload_usersize_' . $rid, $upload_usersize_default),
       '#size' => 7,
       '#maxlength' => 7,
       '#description' => t('The maximum size of all files a user can have on the site. Set to 0 for no restriction.'),
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.4
diff -u -r1.4 upload.test
--- modules/upload/upload.test	15 Sep 2008 09:28:50 -0000	1.4
+++ modules/upload/upload.test	29 Sep 2008 22:13:57 -0000
@@ -29,9 +29,9 @@
     // Setup upload settings.
     $edit = array();
     $edit['upload_list_default'] = '1'; // Yes.
-    $edit['upload_extensions_default'] = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
-    $edit['upload_uploadsize_default'] = '1.5';
-    $edit['upload_usersize_default'] = '1.5';
+    $edit['upload_extensions'] = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
+    $edit['upload_uploadsize'] = '1.5';
+    $edit['upload_usersize'] = '1.5';
     $this->drupalPost('admin/settings/uploads', $edit, t('Save configuration'));
     $this->assertText('The configuration options have been saved.', 'Upload setting saved.');
 
@@ -149,7 +149,12 @@
   function setUploadSettings($settings, $rid = NULL) {
     $edit = array();
     foreach ($settings as $key => $value) {
-      $edit[$key . '_default'] = $value;
+      if ($key != 'upload_list') {
+        $edit[$key] = $value;
+      }
+      else {
+        $edit['upload_list_default'] = $value;
+      }
       if ($rid !== NULL && $key != 'upload_list' && $key != 'upload_max_resolution') {
         $edit[$key . '_' . $rid] = $value;
       }
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.27
diff -u -r1.27 user.admin.inc
--- modules/user/user.admin.inc	17 Sep 2008 20:37:32 -0000	1.27
+++ modules/user/user.admin.inc	29 Sep 2008 22:13:57 -0000
@@ -231,9 +231,9 @@
 function user_admin_settings() {
   // User registration settings.
   $form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings'));
-  $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
-  $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
-  $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
+  $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
+  $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
+  $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
 
   // User e-mail settings.
   $form['email'] = array(
@@ -249,7 +249,7 @@
     '#type' => 'fieldset',
     '#title' => t('Welcome, new user created by administrator'),
     '#collapsible' => TRUE,
-    '#collapsed' => (variable_get('user_register', 1) != 0),
+    '#collapsed' => (variable_get('user_register') != 0),
     '#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
   );
   $form['email']['admin_created']['user_mail_register_admin_created_subject'] = array(
@@ -269,7 +269,7 @@
     '#type' => 'fieldset',
     '#title' => t('Welcome, no approval required'),
     '#collapsible' => TRUE,
-    '#collapsed' => (variable_get('user_register', 1) != 1),
+    '#collapsed' => (variable_get('user_register') != 1),
     '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help
   );
   $form['email']['no_approval_required']['user_mail_register_no_approval_required_subject'] = array(
@@ -289,7 +289,7 @@
     '#type' => 'fieldset',
     '#title' => t('Welcome, awaiting administrator approval'),
     '#collapsible' => TRUE,
-    '#collapsed' => (variable_get('user_register', 1) != 2),
+    '#collapsed' => (variable_get('user_register') != 2),
     '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help,
   );
   $form['email']['pending_approval']['user_mail_register_pending_approval_subject'] = array(
@@ -335,7 +335,6 @@
   $form['email']['activated']['user_mail_status_activated_notify'] = array(
     '#type' => 'checkbox',
     '#title' => t('Notify user when account is activated.'),
-    '#default_value' => variable_get('user_mail_status_activated_notify', TRUE),
   );
   $form['email']['activated']['user_mail_status_activated_subject'] = array(
     '#type' => 'textfield',
@@ -360,7 +359,6 @@
   $form['email']['blocked']['user_mail_status_blocked_notify'] = array(
     '#type' => 'checkbox',
     '#title' => t('Notify user when account is blocked.'),
-    '#default_value' => variable_get('user_mail_status_blocked_notify', FALSE),
   );
   $form['email']['blocked']['user_mail_status_blocked_subject'] = array(
     '#type' => 'textfield',
@@ -385,7 +383,6 @@
   $form['email']['deleted']['user_mail_status_deleted_notify'] = array(
     '#type' => 'checkbox',
     '#title' => t('Notify user when account is deleted.'),
-    '#default_value' => variable_get('user_mail_status_deleted_notify', FALSE),
   );
   $form['email']['deleted']['user_mail_status_deleted_subject'] = array(
     '#type' => 'textfield',
@@ -408,13 +405,12 @@
   $form['signatures']['user_signatures'] = array(
     '#type' => 'radios',
     '#title' => t('Signature support'),
-    '#default_value' => variable_get('user_signatures', 0),
     '#options' => array(t('Disabled'), t('Enabled')),
   );
 
   // If picture support is enabled, check whether the picture directory exists:
-  if (variable_get('user_pictures', 0)) {
-    $picture_path = file_create_path(variable_get('user_picture_path', 'pictures'));
+  if (variable_get('user_pictures')) {
+    $picture_path = file_create_path(variable_get('user_picture_path'));
     file_check_directory($picture_path, 1, 'user_picture_path');
   }
 
@@ -422,11 +418,10 @@
     '#type' => 'fieldset',
     '#title' => t('Pictures'),
   );
-  $picture_support = variable_get('user_pictures', 0);
+  $picture_support = variable_get('user_pictures');
   $form['pictures']['user_pictures'] = array(
     '#type' => 'radios',
     '#title' => t('Picture support'),
-    '#default_value' => $picture_support,
     '#options' => array(t('Disabled'), t('Enabled')),
     '#prefix' => '<div class="user-admin-picture-radios">',
     '#suffix' => '</div>',
@@ -446,7 +441,6 @@
   $form['pictures']['settings']['user_picture_path'] = array(
     '#type' => 'textfield',
     '#title' => t('Picture image path'),
-    '#default_value' => variable_get('user_picture_path', 'pictures'),
     '#size' => 30,
     '#maxlength' => 255,
     '#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() . '/')),
@@ -454,7 +448,6 @@
   $form['pictures']['settings']['user_picture_default'] = array(
     '#type' => 'textfield',
     '#title' => t('Default picture'),
-    '#default_value' => variable_get('user_picture_default', ''),
     '#size' => 30,
     '#maxlength' => 255,
     '#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.'),
@@ -462,7 +455,6 @@
   $form['pictures']['settings']['user_picture_dimensions'] = array(
     '#type' => 'textfield',
     '#title' => t('Picture maximum dimensions'),
-    '#default_value' => variable_get('user_picture_dimensions', '85x85'),
     '#size' => 15,
     '#maxlength' => 10,
     '#description' => t('Maximum dimensions for pictures, in pixels.'),
@@ -470,7 +462,6 @@
   $form['pictures']['settings']['user_picture_file_size'] = array(
     '#type' => 'textfield',
     '#title' => t('Picture maximum file size'),
-    '#default_value' => variable_get('user_picture_file_size', '30'),
     '#size' => 15,
     '#maxlength' => 10,
     '#description' => t('Maximum file size for pictures, in kB.'),
@@ -478,7 +469,6 @@
   $form['pictures']['settings']['user_picture_guidelines'] = array(
     '#type' => 'textarea',
     '#title' => t('Picture guidelines'),
-    '#default_value' => variable_get('user_picture_guidelines', ''),
     '#description' => t("This text is displayed at the picture upload form in addition to the default guidelines. It's useful for helping or instructing your users."),
   );
 
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.15
diff -u -r1.15 user.test
--- modules/user/user.test	20 Sep 2008 20:22:25 -0000	1.15
+++ modules/user/user.test	29 Sep 2008 22:13:57 -0000
@@ -44,8 +44,8 @@
     $this->assertEqual($user->theme, '', t('Correct theme field.'));
     $this->assertEqual($user->signature, '', t('Correct signature field.'));
     $this->assertTrue(($user->created > REQUEST_TIME - 20 ), t('Correct creation time.'));
-    $this->assertEqual($user->status, variable_get('user_register', 1) == 1 ? 1 : 0, t('Correct status field.'));
-    $this->assertEqual($user->timezone, variable_get('date_default_timezone', NULL), t('Correct timezone field.'));
+    $this->assertEqual($user->status, variable_get('user_register') == 1 ? 1 : 0, t('Correct status field.'));
+    $this->assertEqual($user->timezone, variable_get('date_default_timezone'), t('Correct timezone field.'));
     $this->assertEqual($user->language, '', t('Correct language field.'));
     $this->assertEqual($user->picture, '', t('Correct picture field.'));
     $this->assertEqual($user->init, $mail, t('Correct init field.'));
@@ -75,7 +75,7 @@
     $this->assertText(t('The changes have been saved.'), t('Password changed to @password', array('@password' => $new_pass)));
 
     // Make sure password changes are present in database.
-    require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+    require_once DRUPAL_ROOT . '/' . variable_get('password_inc');
 
     $user = user_load(array('uid' => $user->uid));
     $this->assertTrue(user_check_password($new_pass, $user), t('Correct password in database.'));
@@ -225,7 +225,7 @@
     $file_dir = file_directory_path();
     $file_check = file_check_directory($file_dir, FILE_CREATE_DIRECTORY, 'file_directory_path');
 
-    $picture_dir = variable_get('user_picture_path', 'pictures');
+    $picture_dir = variable_get('user_picture_path');
     $picture_path = $file_dir .'/'.$picture_dir;
 
     $pic_check = file_check_directory($picture_path, FILE_CREATE_DIRECTORY, 'user_picture_path');
@@ -329,7 +329,7 @@
         variable_set('user_picture_file_size', $test_size);
 
         $pic_path = $this->saveUserPicture($image);
-        $text = t('The uploaded image is too large; the maximum dimensions are %dimensions pixels.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85')));
+        $text = t('The uploaded image is too large; the maximum dimensions are %dimensions pixels.', array('%dimensions' => variable_get('user_picture_dimensions')));
         $this->assertText($text, t('Checking response on invalid image (dimensions).'));
 
         // check if file is not uploaded
@@ -360,7 +360,7 @@
         variable_set('user_picture_file_size', $test_size);
 
         $pic_path = $this->saveUserPicture($image);
-        $text = t('The uploaded image is too large; the maximum file size is %size kB.', array('%size' => variable_get('user_picture_file_size', '30')));
+        $text = t('The uploaded image is too large; the maximum file size is %size kB.', array('%size' => variable_get('user_picture_file_size')));
         $this->assertText($text, t('Checking response on invalid image size.'));
 
         // check if file is not uploaded
@@ -403,7 +403,7 @@
     $this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save'));
 
     $img_info = image_get_info($image->filename);
-    $picture_dir = variable_get('user_picture_path', 'pictures');
+    $picture_dir = variable_get('user_picture_path');
     $pic_path = file_directory_path() . '/' . $picture_dir . '/picture-' . $this->user->uid . '.' . $img_info['extension'];
 
     return $pic_path;
Index: modules/user/user.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.install,v
retrieving revision 1.13
diff -u -r1.13 user.install
--- modules/user/user.install	20 Sep 2008 20:22:25 -0000	1.13
+++ modules/user/user.install	29 Sep 2008 22:13:57 -0000
@@ -251,7 +251,7 @@
     $sandbox['user_count'] = db_result(db_query("SELECT COUNT(uid) FROM {users}"));
   }
   else {
-    require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+    require_once DRUPAL_ROOT . '/' . variable_get('password_inc');
     //  Hash again all current hashed passwords.
     $has_rows = FALSE;
     // Update this many per page load.
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.924
diff -u -r1.924 user.module
--- modules/user/user.module	21 Sep 2008 15:08:39 -0000	1.924
+++ modules/user/user.module	29 Sep 2008 22:13:57 -0000
@@ -7,6 +7,23 @@
  */
 
 /**
+ * The standard log2 number of iterations for password stretching. This should
+ * increase by 1 at least every other Drupal version in order to counteract
+ * increases in the speed and power of computers available to crack the hashes.
+ */
+define('DRUPAL_HASH_COUNT', 14);
+
+/**
+ * The minimum allowed log2 number of iterations for password stretching.
+ */
+define('DRUPAL_MIN_HASH_COUNT', 7);
+
+/**
+ * The maximum allowed log2 number of iterations for password stretching.
+ */
+define('DRUPAL_MAX_HASH_COUNT', 30);
+
+/**
  * Maximum length of username text field.
  */
 define('USERNAME_MAX_LENGTH', 60);
@@ -17,6 +34,34 @@
 define('EMAIL_MAX_LENGTH', 64);
 
 /**
+ * Implementation of hook_variables().
+ */
+function user_variables() {
+  return array(
+    'user_register' => 1,
+    'user_registration_help' => '',
+    'user_email_verification' => TRUE,
+    'user_signatures' => 0,
+    'user_pictures' => 0,
+    'user_picture_path' => 'pictures',
+    'user_picture_default' => '',
+    'user_picture_dimensions' => '85x85',
+    'user_picture_file_size' => 30,
+    'user_picture_guidelines' => '',
+    'user_block_whois_new_count' => 5,
+    'user_block_seconds_online' => 900,
+    'user_block_max_list_count' => 10,
+    // Use user_mail_notify_status as a fallback for an unknown $op, which will
+    // default to TRUE; however, we don't want mail notifications on by default
+    // with deletions and blockings.
+    'user_mail_notify_status' => TRUE,
+    'user_mail_notify_status_deleted' => FALSE,
+    'user_mail_notify_status_blocked' => FALSE,
+    'password_count_log2' => DRUPAL_HASH_COUNT,
+  );
+}
+
+/**
  * Invokes hook_user() in every module.
  *
  * We cannot use module_invoke() for this, because the arguments need to
@@ -222,7 +267,7 @@
 
   if (!empty($edit['pass'])) {
     // Allow alternate password hashing schemes.
-    require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+    require_once DRUPAL_ROOT . '/' . variable_get('password_inc');
     $edit['pass'] = user_hash_password(trim($edit['pass']));
     // Abort if the hashing failed and returned FALSE.
     if (!$edit['pass']) {
@@ -401,8 +446,8 @@
   // If required, validate the uploaded picture.
   $validators = array(
     'file_validate_is_image' => array(),
-    'file_validate_image_resolution' => array(variable_get('user_picture_dimensions', '85x85')),
-    'file_validate_size' => array(variable_get('user_picture_file_size', '30') * 1024),
+    'file_validate_image_resolution' => array(variable_get('user_picture_dimensions')),
+    'file_validate_size' => array(variable_get('user_picture_file_size') * 1024),
   );
   if ($file = file_save_upload('picture_upload', $validators)) {
     // Remove the old picture.
@@ -419,7 +464,7 @@
       $form_state['values']['picture'] = $filepath;
     }
     else {
-      form_set_error('picture_upload', t("Failed to upload the picture image; the %directory directory doesn't exist or is not writable.", array('%directory' => variable_get('user_picture_path', 'pictures'))));
+      form_set_error('picture_upload', t("Failed to upload the picture image; the %directory directory doesn't exist or is not writable.", array('%directory' => variable_get('user_picture_path'))));
     }
   }
 }
@@ -584,7 +629,7 @@
  * Ensure that user pictures (avatars) are always downloadable.
  */
 function user_file_download($file) {
-  if (strpos($file, variable_get('user_picture_path', 'pictures') . '/picture-') === 0) {
+  if (strpos($file, variable_get('user_picture_path') . '/picture-') === 0) {
     $info = image_get_info(file_create_path($file));
     return array('Content-type: ' . $info['mime_type']);
   }
@@ -697,7 +742,7 @@
     '#value' => t('Log in'),
   );
   $items = array();
-  if (variable_get('user_register', 1)) {
+  if (variable_get('user_register')) {
     $items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
   }
   $items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
@@ -732,15 +777,15 @@
     $form['user_block_whois_new_count'] = array(
       '#type' => 'select',
       '#title' => t('Number of users to display'),
-      '#default_value' => variable_get('user_block_whois_new_count', 5),
+      '#default_value' => variable_get('user_block_whois_new_count'),
       '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)),
     );
     return $form;
   }
   else if ($op == 'configure' && $delta == 'online') {
     $period = drupal_map_assoc(array(30, 60, 120, 180, 300, 600, 900, 1800, 2700, 3600, 5400, 7200, 10800, 21600, 43200, 86400), 'format_interval');
-    $form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online', 900), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.'));
-    $form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count', 10), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.'));
+    $form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online'), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.'));
+    $form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count'), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.'));
 
     return $form;
   }
@@ -774,7 +819,7 @@
       case 'new':
         if (user_access('access content')) {
           // Retrieve a list of new users who have subsequently accessed the site successfully.
-          $result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5));
+          $result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count'));
           while ($account = db_fetch_object($result)) {
             $items[] = $account;
           }
@@ -788,14 +833,14 @@
       case 'online':
         if (user_access('access content')) {
           // Count users active within the defined period.
-          $interval = REQUEST_TIME - variable_get('user_block_seconds_online', 900);
+          $interval = REQUEST_TIME - variable_get('user_block_seconds_online');
 
           // Perform database queries to gather online user lists.  We use s.timestamp
           // rather than u.access because it is much faster.
           $anonymous_count = drupal_session_count($interval);
           $authenticated_users = db_query('SELECT DISTINCT u.uid, u.name, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', $interval);
           $authenticated_count = 0;
-          $max_users = variable_get('user_block_max_list_count', 10);
+          $max_users = variable_get('user_block_max_list_count');
           $items = array();
           while ($account = db_fetch_object($authenticated_users)) {
             if ($max_users > 0) {
@@ -814,7 +859,7 @@
           }
 
           // Display a list of currently online users.
-          $max_users = variable_get('user_block_max_list_count', 10);
+          $max_users = variable_get('user_block_max_list_count');
           if ($authenticated_count && $max_users) {
             $output .= theme('user_list', $items, t('Online users'));
           }
@@ -837,17 +882,17 @@
  */
 function template_preprocess_user_picture(&$variables) {
   $variables['picture'] = '';
-  if (variable_get('user_pictures', 0)) {
+  if (variable_get('user_pictures')) {
     $account = $variables['account'];
     if (!empty($account->picture) && file_exists($account->picture)) {
       $picture = file_create_url($account->picture);
     }
-    else if (variable_get('user_picture_default', '')) {
-      $picture = variable_get('user_picture_default', '');
+    else if (variable_get('user_picture_default')) {
+      $picture = variable_get('user_picture_default');
     }
 
     if (isset($picture)) {
-      $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
+      $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous')));
       $variables['picture'] = theme('image', $picture, $alt, $alt, '', FALSE);
       if (!empty($account->uid) && user_access('access user profiles')) {
         $attributes = array('attributes' => array('title' => t('View user profile.')), 'html' => TRUE);
@@ -886,7 +931,7 @@
 }
 
 function user_register_access() {
-  return user_is_anonymous() && variable_get('user_register', 1);
+  return user_is_anonymous() && variable_get('user_register');
 }
 
 function user_view_access($account) {
@@ -1230,7 +1275,7 @@
     '#attributes' => array('tabindex' => '1'),
   );
 
-  $form['name']['#description'] = t('Enter your @s username.', array('@s' => variable_get('site_name', 'Drupal')));
+  $form['name']['#description'] = t('Enter your @s username.', array('@s' => variable_get('site_name')));
   $form['pass'] = array('#type' => 'password',
     '#title' => t('Password'),
     '#description' => t('Enter the password that accompanies your username.'),
@@ -1313,7 +1358,7 @@
     $account = db_fetch_object(db_query("SELECT * FROM {users} WHERE name = '%s' AND status = 1", $form_values['name']));
     if ($account) {
       // Allow alternate password hashing schemes.
-      require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+      require_once DRUPAL_ROOT . '/' . variable_get('password_inc');
       if (user_check_password($password, $account)) {
         if (user_needs_new_hash($account)) {
            $new_hash = user_hash_password($password);
@@ -1437,7 +1482,7 @@
       '#size' => 25,
     );
   }
-  elseif (!variable_get('user_email_verification', TRUE) || $admin) {
+  elseif (!variable_get('user_email_verification') || $admin) {
     $form['account']['pass'] = array(
       '#type' => 'password_confirm',
       '#description' => t('Provide a password for the new account in both fields.'),
@@ -1482,7 +1527,7 @@
   }
 
   // Signature:
-  if (variable_get('user_signatures', 0) && module_exists('comment') && !$register) {
+  if (variable_get('user_signatures') && module_exists('comment') && !$register) {
     $form['signature_settings'] = array(
       '#type' => 'fieldset',
       '#title' => t('Signature settings'),
@@ -1497,7 +1542,7 @@
   }
 
   // Picture/avatar:
-  if (variable_get('user_pictures', 0) && !$register) {
+  if (variable_get('user_pictures') && !$register) {
     $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
     $picture = theme('user_picture', (object)$edit);
     if ($edit['picture']) {
@@ -1507,7 +1552,7 @@
     else {
       $form['picture']['picture_delete'] = array('#type' => 'hidden');
     }
-    $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) . ' ' . variable_get('user_picture_guidelines', ''));
+    $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions'), '%size' => variable_get('user_picture_file_size'))) . ' ' . variable_get('user_picture_guidelines'));
     $form['#validate'][] = 'user_validate_picture';
   }
   $form['#uid'] = $uid;
@@ -1604,7 +1649,7 @@
 function _user_mail_text($key, $language = NULL, $variables = array()) {
   $langcode = isset($language) ? $language->language : NULL;
 
-  if ($admin_setting = variable_get('user_mail_' . $key, FALSE)) {
+  if ($admin_setting = variable_get('user_mail_' . $key)) {
     // An admin setting overrides the default string.
     return strtr($admin_setting, $variables);
   }
@@ -1997,7 +2042,7 @@
 function user_comment(&$comment, $op) {
   // Validate signature.
   if ($op == 'view') {
-    if (variable_get('user_signatures', 0) && !empty($comment->signature)) {
+    if (variable_get('user_signatures') && !empty($comment->signature)) {
       $comment->signature = check_markup($comment->signature, $comment->format);
     }
     else {
@@ -2038,7 +2083,7 @@
   global $base_url;
   $tokens = array(
     '!username' => $account->name,
-    '!site' => variable_get('site_name', 'Drupal'),
+    '!site' => variable_get('site_name'),
     '!login_url' => user_pass_reset_url($account),
     '!uri' => $base_url,
     '!uri_brief' => preg_replace('!^https?://!', '', $base_url),
@@ -2102,9 +2147,7 @@
  *  The return value from drupal_mail_send(), if ends up being called.
  */
 function _user_mail_notify($op, $account, $language = NULL) {
-  // By default, we always notify except for deleted and blocked.
-  $default_notify = ($op != 'status_deleted' && $op != 'status_blocked');
-  $notify = variable_get('user_mail_' . $op . '_notify', $default_notify);
+  $notify = variable_get('user_mail_notify_' . $op);
   if ($notify) {
     $params['account'] = $account;
     $language = $language ? $language : user_preferred_language($account);
@@ -2112,7 +2155,7 @@
     if ($op == 'register_pending_approval') {
       // If a user registered requiring admin approval, notify the admin, too.
       // We use the site default language for this.
-      drupal_mail('user', 'register_pending_approval_admin', variable_get('site_mail', ini_get('sendmail_from')), language_default(), $params);
+      drupal_mail('user', 'register_pending_approval_admin', variable_get('site_mail'), language_default(), $params);
     }
   }
   return empty($mail) ? NULL : $mail['result'];
@@ -2229,14 +2272,14 @@
 
   $mail = $form_state['values']['mail'];
   $name = $form_state['values']['name'];
-  if (!variable_get('user_email_verification', TRUE) || $admin) {
+  if (!variable_get('user_email_verification') || $admin) {
     $pass = $form_state['values']['pass'];
   }
   else {
     $pass = user_password();
   };
   $notify = isset($form_state['values']['notify']) ? $form_state['values']['notify'] : NULL;
-  $from = variable_get('site_mail', ini_get('sendmail_from'));
+  $from = variable_get('site_mail');
   if (isset($form_state['values']['roles'])) {
     // Remove unset roles.
     $roles = array_filter($form_state['values']['roles']);
@@ -2257,7 +2300,7 @@
   $merge_data = array('pass' => $pass, 'init' => $mail, 'roles' => $roles);
   if (!$admin) {
     // Set the user's status because it was not displayed in the form.
-    $merge_data['status'] = variable_get('user_register', 1) == 1;
+    $merge_data['status'] = variable_get('user_register') == 1;
   }
   $account = user_save('', array_merge($form_state['values'], $merge_data));
   // Terminate if an error occured during user_save().
@@ -2273,7 +2316,7 @@
   // The first user may login immediately, and receives a customized welcome e-mail.
   if ($account->uid == 1) {
     drupal_set_message(t('Welcome to Drupal. You are now logged in as user #1, which gives you full control over your website.'));
-    if (variable_get('user_email_verification', TRUE)) {
+    if (variable_get('user_email_verification')) {
       drupal_set_message(t('</p><p> Your password is <strong>%pass</strong>. You may change your password below.</p>', array('%pass' => $pass)));
     }
 
@@ -2288,7 +2331,7 @@
     if ($admin && !$notify) {
       drupal_set_message(t('Created a new user account for <a href="@url">%name</a>. No e-mail has been sent.', array('@url' => url("user/$account->uid"), '%name' => $account->name)));
     }
-    else if (!variable_get('user_email_verification', TRUE) && $account->status && !$admin) {
+    else if (!variable_get('user_email_verification') && $account->status && !$admin) {
       // No e-mail verification is required, create new user account, and login
       // user immediately.
       _user_mail_notify('register_no_approval_required', $account);
@@ -2343,7 +2386,7 @@
 
   // Display the registration form.
   if (!$admin) {
-    $form['user_registration_help'] = array('#markup' => filter_xss_admin(variable_get('user_registration_help', '')));
+    $form['user_registration_help'] = array('#markup' => filter_xss_admin(variable_get('user_registration_help')));
   }
 
   // Merge in the default user edit fields.
@@ -2375,12 +2418,12 @@
     $form = array_merge($form, $extra);
   }
 
-  if (variable_get('configurable_timezones', 1)) {
+  if (variable_get('configurable_timezones')) {
     // Override field ID, so we only change timezone on user registration,
     // and never touch it on user edit pages.
     $form['timezone'] = array(
       '#type' => 'hidden',
-      '#default_value' => variable_get('date_default_timezone', NULL),
+      '#default_value' => variable_get('date_default_timezone'),
       '#id' => 'edit-user-register-timezone',
     );
 
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.169
diff -u -r1.169 menu.module
--- modules/menu/menu.module	27 Sep 2008 20:37:00 -0000	1.169
+++ modules/menu/menu.module	29 Sep 2008 22:13:56 -0000
@@ -13,6 +13,16 @@
 define('MENU_MAX_MENU_NAME_LENGTH_UI', 27);
 
 /**
+ * Implementation of hook_variables().
+ */
+function menu_variables() {
+  return array(
+    'menu_default_node_menu' => 'main-menu',
+    'menu_override_parent_selector' => FALSE,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function menu_help($path, $arg) {
@@ -197,7 +207,7 @@
   // allow contrib modules to provide more scalable pattern choosers.
   // hook_form_alter is too late in itself because all the possible parents are
   // retrieved here, unless menu_override_parent_selector is set to TRUE.
-  if (variable_get('menu_override_parent_selector', FALSE)) {
+  if (variable_get('menu_override_parent_selector')) {
     return array();
   }
   // If the item has children, there is an added limit to the depth of valid parents.
@@ -310,7 +320,7 @@
     case 'prepare':
       if (empty($node->menu)) {
         // Prepare the node for the edit form so that $node->menu always exists.
-        $menu_name = variable_get('menu_default_node_menu', 'main-menu');
+        $menu_name = variable_get('menu_default_node_menu');
         $item = array();
         if (isset($node->nid)) {
           // Give priority to the default menu
Index: modules/menu/menu.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v
retrieving revision 1.33
diff -u -r1.33 menu.admin.inc
--- modules/menu/menu.admin.inc	18 Sep 2008 10:44:19 -0000	1.33
+++ modules/menu/menu.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -607,12 +607,12 @@
   $form['menu_default_node_menu'] = array(
     '#type' => 'select',
     '#title' => t('Default menu for content'),
-    '#default_value' => variable_get('menu_default_node_menu', 'main-menu'),
+    '#default_value' => variable_get('menu_default_node_menu'),
     '#options' => $menu_options,
     '#description' => t('Choose the menu to be the default in the menu options in the content authoring form.'),
   );
 
-  $main = variable_get('menu_main_links_source', 'main-menu');
+  $main = variable_get('menu_main_links_source');
   $main_options = array_merge($menu_options, array('' => t('No Main links')));
   $form['menu_main_links_source'] = array(
     '#type' => 'select',
@@ -627,7 +627,7 @@
   $form["menu_secondary_links_source"] = array(
     '#type' => 'select',
     '#title' => t('Source for the Secondary links'),
-    '#default_value' => variable_get('menu_secondary_links_source', 'secondary-menu'),
+    '#default_value' => variable_get('menu_secondary_links_source'),
     '#options' => $secondary_options,
     '#tree' => FALSE,
     '#description' => t("Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links." , array('%main' => $main_options[$main])),
Index: modules/blog/blog.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.pages.inc,v
retrieving revision 1.10
diff -u -r1.10 blog.pages.inc
--- modules/blog/blog.pages.inc	22 May 2008 19:27:13 -0000	1.10
+++ modules/blog/blog.pages.inc	29 Sep 2008 22:13:56 -0000
@@ -25,7 +25,7 @@
 
   $output = theme('item_list', $items);
 
-  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
+  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main'), 0, NULL, $account->uid);
   $has_posts = FALSE;
 
   while ($node = db_fetch_object($result)) {
@@ -34,7 +34,7 @@
   }
 
   if ($has_posts) {
-    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+    $output .= theme('pager', NULL, variable_get('default_nodes_main'));
   }
   else {
     if ($account->uid == $user->uid) {
@@ -64,7 +64,7 @@
 
   $output = theme('item_list', $items);
 
-  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
+  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main'));
   $has_posts = FALSE;
 
   while ($node = db_fetch_object($result)) {
@@ -73,7 +73,7 @@
   }
 
   if ($has_posts) {
-    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+    $output .= theme('pager', NULL, variable_get('default_nodes_main'));
   }
   else {
     drupal_set_message(t('No blog entries have been created.'));
@@ -87,7 +87,7 @@
  * Menu callback; displays an RSS feed containing recent blog entries of a given user.
  */
 function blog_feed_user($account) {
-  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n  WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
+  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n  WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items'));
   $channel['title'] = $account->name . "'s blog";
   $channel['link'] = url('blog/' . $account->uid, array('absolute' => TRUE));
 
@@ -102,8 +102,8 @@
  * Menu callback; displays an RSS feed containing recent blog entries of all users.
  */
 function blog_feed_last() {
-  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
-  $channel['title'] = variable_get('site_name', 'Drupal') . ' blogs';
+  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items'));
+  $channel['title'] = variable_get('site_name') . ' blogs';
   $channel['link'] = url('blog', array('absolute' => TRUE));
 
   $items = array();
Index: modules/contact/contact.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v
retrieving revision 1.5
diff -u -r1.5 contact.admin.inc
--- modules/contact/contact.admin.inc	2 Jul 2008 20:05:11 -0000	1.5
+++ modules/contact/contact.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -146,19 +146,16 @@
 function contact_admin_settings() {
   $form['contact_form_information'] = array('#type' => 'textarea',
     '#title' => t('Additional information'),
-    '#default_value' => variable_get('contact_form_information', t('You can leave a message using the contact form below.')),
     '#description' => t('Information to show on the <a href="@form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('@form' => url('contact'))),
   );
   $form['contact_hourly_threshold'] = array('#type' => 'select',
     '#title' => t('Hourly threshold'),
     '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
-    '#default_value' => variable_get('contact_hourly_threshold', 3),
     '#description' => t('The maximum number of contact form submissions a user can perform per hour.'),
   );
   $form['contact_default_status'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable personal contact form by default'),
-    '#default_value' => variable_get('contact_default_status', 1),
     '#description' => t('Default status of the personal contact form for new users.'),
   );
   return system_settings_form($form);
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.11
diff -u -r1.11 contact.pages.inc
--- modules/contact/contact.pages.inc	16 Jul 2008 21:59:26 -0000	1.11
+++ modules/contact/contact.pages.inc	29 Sep 2008 22:13:56 -0000
@@ -13,8 +13,8 @@
 function contact_site_page() {
   global $user;
 
-  if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) {
-    $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
+  if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold')) && !user_access('administer site-wide contact form')) {
+    $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold')));
   }
   else {
     $output = drupal_get_form('contact_mail_page');
@@ -38,7 +38,7 @@
 
   if (count($categories) > 0) {
     $form['#token'] = $user->uid ? $user->name . $user->mail : '';
-    $form['contact_information'] = array('#markup' => filter_xss_admin(variable_get('contact_form_information', t('You can leave a message using the contact form below.'))));
+    $form['contact_information'] = array('#markup' => filter_xss_admin(variable_get('contact_form_information')));
     $form['name'] = array('#type' => 'textfield',
       '#title' => t('Your name'),
       '#maxlength' => 255,
@@ -160,8 +160,8 @@
   if (!valid_email_address($user->mail)) {
     $output = t('You need to provide a valid e-mail address to contact other users. Please update your <a href="@url">user information</a> and try again.', array('@url' => url("user/$user->uid/edit", array('query' => 'destination=' . drupal_get_destination()))));
   }
-  else if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) {
-    $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
+  else if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold')) && !user_access('administer site-wide contact form')) {
+    $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold')));
   }
   else {
     drupal_set_title(check_plain($account->name));
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.109
diff -u -r1.109 contact.module
--- modules/contact/contact.module	17 Sep 2008 20:37:32 -0000	1.109
+++ modules/contact/contact.module	29 Sep 2008 22:13:56 -0000
@@ -7,6 +7,17 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function contact_variables() {
+  return array(
+    'contact_form_information' => t('You can leave a message using the contact form below.'),
+    'contact_hourly_threshold' => 3,
+    'contact_default_status' => 1,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function contact_help($path, $arg) {
@@ -152,7 +163,7 @@
     return array('contact' => isset($edit['contact']) ? $edit['contact'] : FALSE);
   }
   elseif ($type == 'insert') {
-    $edit['contact'] = variable_get('contact_default_status', 1);
+    $edit['contact'] = variable_get('contact_default_status');
   }
 }
 
@@ -178,9 +189,9 @@
     case 'user_copy':
       $user = $params['user'];
       $account = $params['account'];
-      $message['subject'] .= '[' . variable_get('site_name', 'Drupal') . '] ' . $params['subject'];
+      $message['subject'] .= '[' . variable_get('site_name') . '] ' . $params['subject'];
       $message['body'][] = "$account->name,";
-      $message['body'][] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE, 'language' => $language)), '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)), '!site' => variable_get('site_name', 'Drupal')), $language->language);
+      $message['body'][] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE, 'language' => $language)), '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)), '!site' => variable_get('site_name')), $language->language);
       $message['body'][] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE, 'language' => $language))), $language->language);
       $message['body'][] = t('Message:', NULL, $language->language);
       $message['body'][] = $params['message'];
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.10
diff -u -r1.10 contact.install
--- modules/contact/contact.install	18 Dec 2007 12:59:21 -0000	1.10
+++ modules/contact/contact.install	29 Sep 2008 22:13:56 -0000
@@ -15,10 +15,6 @@
 function contact_uninstall() {
   // Remove tables.
   drupal_uninstall_schema('contact');
-
-  variable_del('contact_default_status');
-  variable_del('contact_form_information');
-  variable_del('contact_hourly_threshold');
 }
 
 /**
Index: modules/simpletest/simpletest.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.install,v
retrieving revision 1.10
diff -u -r1.10 simpletest.install
--- modules/simpletest/simpletest.install	20 Sep 2008 03:49:23 -0000	1.10
+++ modules/simpletest/simpletest.install	29 Sep 2008 22:13:57 -0000
@@ -92,10 +92,6 @@
  * Implementation of hook_uninstall().
  */
 function simpletest_uninstall() {
-  variable_del('simpletest_httpauth');
-  variable_del('simpletest_httpauth_username');
-  variable_del('simpletest_httpauth_pass');
-  variable_del('simpletest_devel');
   drupal_uninstall_schema('simpletest');
 }
 
Index: modules/simpletest/simpletest.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.test,v
retrieving revision 1.9
diff -u -r1.9 simpletest.test
--- modules/simpletest/simpletest.test	15 Sep 2008 20:48:09 -0000	1.9
+++ modules/simpletest/simpletest.test	29 Sep 2008 22:13:57 -0000
@@ -50,7 +50,7 @@
     global $conf;
     if (!$this->inCURL()) {
       $this->drupalGet('node');
-      $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.'));
+      $this->assertTitle(variable_get('site_name'), t('Site title matches.'));
       // Make sure that we are locked out of the installer when prefixing
       // using the user-agent header. This is an important security check.
       global $base_url;
Index: modules/simpletest/simpletest.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v
retrieving revision 1.15
diff -u -r1.15 simpletest.module
--- modules/simpletest/simpletest.module	20 Sep 2008 20:22:24 -0000	1.15
+++ modules/simpletest/simpletest.module	29 Sep 2008 22:13:57 -0000
@@ -2,6 +2,16 @@
 // $Id: simpletest.module,v 1.15 2008/09/20 20:22:24 webchick Exp $
 
 /**
+ * Implementation of hook_variables().
+ */
+function simpletest_variables() {
+  return array(
+    'simpletest_httpauth_username' => '',
+    'simpletest_httpauth_pass' => '',
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function simpletest_help($path, $arg) {
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.45
diff -u -r1.45 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	20 Sep 2008 20:22:24 -0000	1.45
+++ modules/simpletest/drupal_web_test_case.php	29 Sep 2008 22:13:57 -0000
@@ -681,7 +681,7 @@
 
     // Store necessary current values before switching to prefixed database.
     $this->db_prefix_original = $db_prefix;
-    $clean_url_original = variable_get('clean_url', 0);
+    $clean_url_original = variable_get('clean_url');
 
     // Generate temporary prefixed database to ensure that tests have a clean starting point.
     $db_prefix = 'simpletest' . mt_rand(1000, 1000000);
@@ -705,9 +705,9 @@
     default_profile_tasks($task, '');
 
     // Rebuild caches.
-    menu_rebuild();
+    drupal_flush_all_caches();
+    variable_default(NULL, TRUE);
     actions_synchronize();
-    _drupal_flush_css_js();
     $this->refreshVariables();
     $this->checkPermissions(array(), TRUE);
 
@@ -765,7 +765,7 @@
       $this->_logged_in = FALSE;
 
       // Reload module list to ensure that test module hooks aren't called after tests.
-      module_list(TRUE);
+      module_list(TRUE, FALSE);
 
       // Rebuild caches.
       $this->refreshVariables();
@@ -797,8 +797,8 @@
       if (preg_match('/simpletest\d+/', $db_prefix)) {
         $curl_options[CURLOPT_USERAGENT] = $db_prefix;
       }
-      if (!isset($curl_options[CURLOPT_USERPWD]) && ($auth = variable_get('simpletest_httpauth_username', ''))) {
-        if ($pass = variable_get('simpletest_httpauth_pass', '')) {
+      if (!isset($curl_options[CURLOPT_USERPWD]) && ($auth = variable_get('simpletest_httpauth_username'))) {
+        if ($pass = variable_get('simpletest_httpauth_pass')) {
           $auth .= ':' . $pass;
         }
         $curl_options[CURLOPT_USERPWD] = $auth;
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.78
diff -u -r1.78 chameleon.theme
--- themes/chameleon/chameleon.theme	25 Jun 2008 09:12:25 -0000	1.78
+++ themes/chameleon/chameleon.theme	29 Sep 2008 22:13:57 -0000
@@ -30,7 +30,7 @@
   $output  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
   $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\" dir=\"$direction\">\n";
   $output .= "<head>\n";
-  $output .= " <title>" . ($title ? strip_tags($title) . " | " . variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") . " | " . variable_get("site_slogan", "")) . "</title>\n";
+  $output .= " <title>" . ($title ? strip_tags($title) . " | " . variable_get("site_name") : variable_get("site_name") . " | " . variable_get("site_slogan")) . "</title>\n";
   $output .= drupal_get_html_head();
   $output .= drupal_get_css();
   $output .= drupal_get_js();
@@ -42,10 +42,10 @@
     $output .= "  <a href=\"" . url() . "\" title=\"" . t('Home') . "\"><img src=\"$logo\" alt=\"" . t('Home') . "\" /></a>";
   }
   if (theme_get_setting('toggle_name')) {
-    $output .= "  <h1 class=\"site-name title\">" . l(variable_get('site_name', 'drupal'), "") . "</h1>";
+    $output .= "  <h1 class=\"site-name title\">" . l(variable_get('site_name'), "") . "</h1>";
   }
   if (theme_get_setting('toggle_slogan')) {
-    $output .= "  <div class=\"site-slogan\">" . variable_get('site_slogan', '') . "</div>";
+    $output .= "  <div class=\"site-slogan\">" . variable_get('site_slogan') . "</div>";
   }
 
   $output .= "</div>\n";
@@ -92,7 +92,7 @@
   $output .= drupal_get_feeds();
   $output .= "\n<!-- end content -->\n";
 
-  if ($footer = variable_get('site_footer', '')) {
+  if ($footer = variable_get('site_footer')) {
     $output .= " <div id=\"footer\">$footer</div>\n";
   }
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.430
diff -u -r1.430 taxonomy.module
--- modules/taxonomy/taxonomy.module	27 Sep 2008 20:37:01 -0000	1.430
+++ modules/taxonomy/taxonomy.module	29 Sep 2008 22:13:57 -0000
@@ -7,6 +7,15 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function taxonomy_variables() {
+  return array(
+    'taxonomy_override_selector' => FALSE,
+  );
+}
+
+/**
  * Implementation of hook_perm().
  */
 function taxonomy_perm() {
@@ -503,7 +512,7 @@
  *  and provide scalable alternatives.
  */
 function taxonomy_form_alter(&$form, $form_state, $form_id) {
-  if (!variable_get('taxonomy_override_selector', FALSE) && !empty($form['#node_edit_form'])) {
+  if (!variable_get('taxonomy_override_selector') && !empty($form['#node_edit_form'])) {
     $node = $form['#node'];
 
     if (!isset($node->taxonomy)) {
@@ -1144,10 +1153,10 @@
     $sql = db_rewrite_sql($sql);
     $sql_count = db_rewrite_sql($sql_count);
     if ($pager) {
-      $result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $args);
+      $result = pager_query($sql, variable_get('default_nodes_main'), 0, $sql_count, $args);
     }
     else {
-      $result = db_query_range($sql, $args, 0, variable_get('feed_default_items', 10));
+      $result = db_query_range($sql, $args, 0, variable_get('feed_default_items'));
     }
   }
 
@@ -1166,7 +1175,7 @@
     $has_rows = TRUE;
   }
   if ($has_rows) {
-    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0);
+    $output .= theme('pager', NULL, variable_get('default_nodes_main'), 0);
   }
   else {
     $output .= '<p>' . t('There are currently no posts in this category.') . '</p>';
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.15
diff -u -r1.15 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc	19 Sep 2008 20:25:03 -0000	1.15
+++ modules/taxonomy/taxonomy.pages.inc	29 Sep 2008 22:13:57 -0000
@@ -48,7 +48,7 @@
 
         case 'feed':
           $channel['link'] = url('taxonomy/term/' . $str_tids . '/' . $depth, array('absolute' => TRUE));
-          $channel['title'] = variable_get('site_name', 'Drupal') . ' - ' . $title;
+          $channel['title'] = variable_get('site_name') . ' - ' . $title;
           // Only display the description if we have a single term, to avoid clutter and confusion.
           if (count($tids) == 1) {
             $term = taxonomy_term_load($tids[0]);
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.29
diff -u -r1.29 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	19 Sep 2008 20:25:03 -0000	1.29
+++ modules/taxonomy/taxonomy.admin.inc	29 Sep 2008 22:13:57 -0000
@@ -666,7 +666,7 @@
   // items so we check for taxonomy_override_selector before loading the
   // full vocabulary. Contrib modules can then intercept before
   // hook_form_alter to provide scalable alternatives.
-  if (!variable_get('taxonomy_override_selector', FALSE)) {
+  if (!variable_get('taxonomy_override_selector')) {
     $parent = array_keys(taxonomy_get_parents($edit['tid']));
     $children = taxonomy_get_tree($vocabulary->vid, $edit['tid']);
 
Index: modules/search/search.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.install,v
retrieving revision 1.15
diff -u -r1.15 search.install
--- modules/search/search.install	15 Mar 2008 12:31:29 -0000	1.15
+++ modules/search/search.install	29 Sep 2008 22:13:56 -0000
@@ -15,10 +15,6 @@
 function search_uninstall() {
   // Remove tables.
   drupal_uninstall_schema('search');
-
-  variable_del('minimum_word_size');
-  variable_del('overlap_cjk');
-  variable_del('search_cron_limit');
 }
 
 /**
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.266
diff -u -r1.266 search.module
--- modules/search/search.module	17 Sep 2008 20:37:32 -0000	1.266
+++ modules/search/search.module	29 Sep 2008 22:13:57 -0000
@@ -91,6 +91,31 @@
 '\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}');
 
 /**
+ * Implementation of hook_variables().
+ */
+function search_variables() {
+  return array(
+    'minimum_word_size' => 3,
+    'overlap_cjk' => TRUE,
+    'search_cron_limit' => 100,
+    'search_tag_weights' => array(
+      'h1' => 25,
+      'h2' => 18,
+      'h3' => 15,
+      'h4' => 12,
+      'h5' => 9,
+      'h6' => 6,
+      'u' => 3,
+      'b' => 3,
+      'i' => 3,
+      'strong' => 3,
+      'em' => 3,
+      'a' => 10,
+    ),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function search_help($path, $arg) {
@@ -309,7 +334,7 @@
   search_invoke_preprocess($text);
 
   // Simple CJK handling
-  if (variable_get('overlap_cjk', TRUE)) {
+  if (variable_get('overlap_cjk')) {
     $text = preg_replace_callback('/[' . PREG_CLASS_CJK . ']+/u', 'search_expand_cjk', $text);
   }
 
@@ -337,7 +362,7 @@
  * sequences of characters ('minimum_word_size' long).
  */
 function search_expand_cjk($matches) {
-  $min = variable_get('minimum_word_size', 3);
+  $min = variable_get('minimum_word_size');
   $str = $matches[0];
   $l = drupal_strlen($str);
   // Passthrough short words
@@ -414,7 +439,7 @@
  * @ingroup search
  */
 function search_index($sid, $type, $text) {
-  $minimum_word_size = variable_get('minimum_word_size', 3);
+  $minimum_word_size = variable_get('minimum_word_size');
 
   // Link matching
   global $base_url;
@@ -423,19 +448,7 @@
   // Multipliers for scores of words inside certain HTML tags.  The weights are stored
   // in a variable so that modules can overwrite the default weights.
   // Note: 'a' must be included for link ranking to work.
-  $tags = variable_get('search_tag_weights', array(
-    'h1' => 25,
-    'h2' => 18,
-    'h3' => 15,
-    'h4' => 12,
-    'h5' => 9,
-    'h6' => 6,
-    'u' => 3,
-    'b' => 3,
-    'i' => 3,
-    'strong' => 3,
-    'em' => 3,
-    'a' => 10));
+  $tags = variable_get('search_tag_weights');
 
   // Strip off all ignored tags to speed up processing, but insert space before/after
   // them to keep word boundaries.
@@ -844,7 +857,7 @@
     $split = explode(' ', $word);
     foreach ($split as $s) {
       $num = is_numeric($s);
-      if ($num || drupal_strlen($s) >= variable_get('minimum_word_size', 3)) {
+      if ($num || drupal_strlen($s) >= variable_get('minimum_word_size')) {
         $s = $num ? ((int)ltrim($s, '-0')) : $s;
         if (!isset($scores[$s])) {
           $scores[$s] = $s;
@@ -916,7 +929,7 @@
   $query = search_parse_query($keywords);
 
   if ($query[2] == '') {
-    form_set_error('keys', t('You must include at least one positive keyword with @count characters or more.', array('@count' => variable_get('minimum_word_size', 3))));
+    form_set_error('keys', t('You must include at least one positive keyword with @count characters or more.', array('@count' => variable_get('minimum_word_size'))));
   }
   if ($query[6]) {
     if ($query[6] == 'or') {
Index: modules/search/search.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.admin.inc,v
retrieving revision 1.6
diff -u -r1.6 search.admin.inc
--- modules/search/search.admin.inc	16 Jul 2008 21:59:27 -0000	1.6
+++ modules/search/search.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -55,12 +55,12 @@
 
   // Indexing throttle:
   $form['indexing_throttle'] = array('#type' => 'fieldset', '#title' => t('Indexing throttle'));
-  $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Number of items to index per cron run'), '#default_value' => variable_get('search_cron_limit', 100), '#options' => $items, '#description' => t('The maximum number of items indexed in each pass of a <a href="@cron">cron maintenance task</a>. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => url('admin/reports/status'))));
+  $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Number of items to index per cron run'), '#options' => $items, '#description' => t('The maximum number of items indexed in each pass of a <a href="@cron">cron maintenance task</a>. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => url('admin/reports/status'))));
   // Indexing settings:
   $form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings'));
   $form['indexing_settings']['info'] = array('#markup' => t('<p><em>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</em></p><p><em>The default settings should be appropriate for the majority of sites.</em></p>'));
-  $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
-  $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
+  $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
+  $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
 
   $form['#validate'] = array('search_admin_settings_validate');
 
@@ -77,8 +77,8 @@
     drupal_goto('admin/settings/search/wipe');
   }
   // If these settings change, the index needs to be rebuilt.
-  if ((variable_get('minimum_word_size', 3) != $form_state['values']['minimum_word_size']) ||
-      (variable_get('overlap_cjk', TRUE) != $form_state['values']['overlap_cjk'])) {
+  if ((variable_get('minimum_word_size') != $form_state['values']['minimum_word_size']) ||
+      (variable_get('overlap_cjk') != $form_state['values']['overlap_cjk'])) {
     drupal_set_message(t('The index will be rebuilt.'));
     search_wipe();
   }
Index: profiles/default/default.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v
retrieving revision 1.29
diff -u -r1.29 default.profile
--- profiles/default/default.profile	18 Sep 2008 10:44:19 -0000	1.29
+++ profiles/default/default.profile	29 Sep 2008 22:13:57 -0000
@@ -129,7 +129,7 @@
   variable_set('comment_page', COMMENT_NODE_DISABLED);
 
   // Don't display date and author information for page nodes by default.
-  $theme_settings = variable_get('theme_settings', array());
+  $theme_settings = variable_get('theme_settings');
   $theme_settings['toggle_node_info_page'] = FALSE;
   variable_set('theme_settings', $theme_settings);
 
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.283
diff -u -r1.283 statistics.module
--- modules/statistics/statistics.module	17 Sep 2008 07:11:58 -0000	1.283
+++ modules/statistics/statistics.module	29 Sep 2008 22:13:57 -0000
@@ -7,6 +7,22 @@
  */
 
 /**
+ * Implementation of hook_variables().
+ */
+function statistics_variables() {
+  return array(
+    'statistics_flush_accesslog_timer' => 259200,
+    'statistics_enable_access_log' => 0,
+    'statistics_count_content_views' => 0,
+    'statistics_day_timestamp' => '',
+    'statistics_block_top_day_num' => 0,
+    'statistics_block_top_all_num' => 0,
+    'statistics_block_top_last_num' => 0,
+    'node_cron_views_scale' => 0,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function statistics_help($path, $arg) {
@@ -47,7 +63,7 @@
 
   drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);
 
-  if (variable_get('statistics_count_content_views', 0)) {
+  if (variable_get('statistics_count_content_views')) {
     // We are counting content views.
     if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') {
       // A node has been viewed, so update the node's counters.
@@ -64,7 +80,7 @@
         ->execute();
     }
   }
-  if (variable_get('statistics_enable_access_log', 0)) {
+  if (variable_get('statistics_enable_access_log')) {
     // Log this page access.
     db_insert('accesslog')->fields(array(
       'title' => strip_tags(drupal_get_title()),
@@ -186,7 +202,7 @@
  * Implementation of hook_cron().
  */
 function statistics_cron() {
-  $statistics_timestamp = variable_get('statistics_day_timestamp', '');
+  $statistics_timestamp = variable_get('statistics_day_timestamp');
 
   if ((REQUEST_TIME - $statistics_timestamp) >= 86400) {
     // Reset day counts.
@@ -195,7 +211,7 @@
   }
 
   // Clean up expired access logs.
-  db_query('DELETE FROM {accesslog} WHERE timestamp < %d', REQUEST_TIME - variable_get('statistics_flush_accesslog_timer', 259200));
+  db_query('DELETE FROM {accesslog} WHERE timestamp < %d', REQUEST_TIME - variable_get('statistics_flush_accesslog_timer'));
 }
 
 /**
@@ -251,7 +267,7 @@
 function statistics_block($op = 'list', $delta = '', $edit = array()) {
   switch ($op) {
     case 'list':
-      if (variable_get('statistics_count_content_views', 0)) {
+      if (variable_get('statistics_count_content_views')) {
         $blocks['popular']['info'] = t('Popular content');
         // Too dynamic to cache.
         $blocks['popular']['cache'] = BLOCK_NO_CACHE;
@@ -262,9 +278,9 @@
     case 'configure':
       // Popular content block settings
       $numbers = array('0' => t('Disabled')) + drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40));
-      $form['statistics_block_top_day_num'] = array('#type' => 'select', '#title' => t("Number of day's top views to display"), '#default_value' => variable_get('statistics_block_top_day_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "day" list.'));
-      $form['statistics_block_top_all_num'] = array('#type' => 'select', '#title' => t('Number of all time views to display'), '#default_value' => variable_get('statistics_block_top_all_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "all time" list.'));
-      $form['statistics_block_top_last_num'] = array('#type' => 'select', '#title' => t('Number of most recent views to display'), '#default_value' => variable_get('statistics_block_top_last_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "recently viewed" list.'));
+      $form['statistics_block_top_day_num'] = array('#type' => 'select', '#title' => t("Number of day's top views to display"), '#default_value' => variable_get('statistics_block_top_day_num'), '#options' => $numbers, '#description' => t('How many content items to display in "day" list.'));
+      $form['statistics_block_top_all_num'] = array('#type' => 'select', '#title' => t('Number of all time views to display'), '#default_value' => variable_get('statistics_block_top_all_num'), '#options' => $numbers, '#description' => t('How many content items to display in "all time" list.'));
+      $form['statistics_block_top_last_num'] = array('#type' => 'select', '#title' => t('Number of most recent views to display'), '#default_value' => variable_get('statistics_block_top_last_num'), '#options' => $numbers, '#description' => t('How many content items to display in "recently viewed" list.'));
       return $form;
 
     case 'save':
@@ -277,17 +293,17 @@
       if (user_access('access content')) {
         $content = array();
 
-        $daytop = variable_get('statistics_block_top_day_num', 0);
+        $daytop = variable_get('statistics_block_top_day_num');
         if ($daytop && ($result = statistics_title_list('daycount', $daytop)) && ($node_title_list = node_title_list($result, t("Today's:")))) {
           $content[] = $node_title_list;
         }
 
-        $alltimetop = variable_get('statistics_block_top_all_num', 0);
+        $alltimetop = variable_get('statistics_block_top_all_num');
         if ($alltimetop && ($result = statistics_title_list('totalcount', $alltimetop)) && ($node_title_list = node_title_list($result, t('All time:')))) {
           $content[] = $node_title_list;
         }
 
-        $lasttop = variable_get('statistics_block_top_last_num', 0);
+        $lasttop = variable_get('statistics_block_top_last_num');
         if ($lasttop && ($result = statistics_title_list('timestamp', $lasttop)) && ($node_title_list = node_title_list($result, t('Last viewed:')))) {
           $content[] = $node_title_list;
         }
@@ -333,14 +349,14 @@
  * Implementation of hook_ranking().
  */
 function statistics_ranking() {
-  if (variable_get('statistics_count_content_views', 0)) {
+  if (variable_get('statistics_count_content_views')) {
     return array(
       'views' => array(
         'title' => t('Number of views'),
         'join' => 'LEFT JOIN {node_counter} node_counter ON node_counter.nid = i.sid',
         // Inverse law that maps the highest view count on the site to 1 and 0 to 0.
         'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * %f)',
-        'arguments' => array(variable_get('node_cron_views_scale', 0)),
+        'arguments' => array(variable_get('node_cron_views_scale')),
       ),
     );
   }
Index: modules/statistics/statistics.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.install,v
retrieving revision 1.13
diff -u -r1.13 statistics.install
--- modules/statistics/statistics.install	18 Dec 2007 12:59:22 -0000	1.13
+++ modules/statistics/statistics.install	29 Sep 2008 22:13:57 -0000
@@ -34,14 +34,6 @@
 function statistics_uninstall() {
   // Remove tables.
   drupal_uninstall_schema('statistics');
-
-  variable_del('statistics_count_content_views');
-  variable_del('statistics_enable_access_log');
-  variable_del('statistics_flush_accesslog_timer');
-  variable_del('statistics_day_timestamp');
-  variable_del('statistics_block_top_day_num');
-  variable_del('statistics_block_top_all_num');
-  variable_del('statistics_block_top_last_num');
 }
 
 /**
Index: modules/statistics/statistics.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v
retrieving revision 1.11
diff -u -r1.11 statistics.admin.inc
--- modules/statistics/statistics.admin.inc	17 Sep 2008 07:11:58 -0000	1.11
+++ modules/statistics/statistics.admin.inc	29 Sep 2008 22:13:57 -0000
@@ -64,7 +64,7 @@
     $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4));
   }
 
-  drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
+  drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer')))));
   $output = theme('table', $header, $rows);
   $output .= theme('pager', NULL, 30, 0);
   return $output;
@@ -97,7 +97,7 @@
     $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4));
   }
 
-  drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
+  drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer')))));
   $output = theme('table', $header, $rows);
   $output .= theme('pager', NULL, 30, 0);
   return $output;
@@ -109,7 +109,7 @@
 function statistics_top_referrers() {
   $query = "SELECT url, COUNT(url) AS hits, MAX(timestamp) AS last FROM {accesslog} WHERE url NOT LIKE :host AND url <> '' GROUP BY url";
   $query_cnt = "SELECT COUNT(DISTINCT(url)) FROM {accesslog} WHERE url <> '' AND url NOT LIKE :host";
-  drupal_set_title(t('Top referrers in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
+  drupal_set_title(t('Top referrers in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer')))));
 
   $header = array(
     array('data' => t('Hits'), 'field' => 'hits', 'sort' => 'desc'),
@@ -189,14 +189,12 @@
   $form['access']['statistics_enable_access_log'] = array(
     '#type' => 'radios',
     '#title' => t('Enable access log'),
-    '#default_value' => variable_get('statistics_enable_access_log', 0),
     '#options' => $options,
     '#description' => t('Log each page access. Required for referrer statistics.'));
   $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
   $form['access']['statistics_flush_accesslog_timer'] = array(
     '#type' => 'select',
     '#title' => t('Discard access logs older than'),
-    '#default_value'   => variable_get('statistics_flush_accesslog_timer', 259200),
     '#options' => $period,
     '#description' => t('Older access log entries (including referrer statistics) will be automatically discarded. (Requires a correctly configured <a href="@cron">cron maintenance task</a>.)', array('@cron' => url('admin/reports/status'))));
 
@@ -207,7 +205,6 @@
   $form['content']['statistics_count_content_views'] = array(
     '#type' => 'radios',
     '#title' => t('Count content views'),
-    '#default_value' => variable_get('statistics_count_content_views', 0),
     '#options' => $options,
     '#description' => t('Increment a counter each time content is viewed.'));
 
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.227
diff -u -r1.227 filter.module
--- modules/filter/filter.module	19 Sep 2008 07:53:59 -0000	1.227
+++ modules/filter/filter.module	29 Sep 2008 22:13:56 -0000
@@ -15,6 +15,19 @@
 define('FILTER_FORMAT_DEFAULT', 0);
 
 /**
+ * Implementation of hook_variables().
+ */
+function filter_variables() {
+  return array(
+    'filter_default_format' => 1,
+    'allowed_html' => '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>',
+    'filter_html_help' => 1,
+    'filter_html_nofollow' => FALSE,
+    'filter_allowed_protocols' => array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'telnet', 'webcal'),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function filter_help($path, $arg) {
@@ -166,20 +179,20 @@
   global $base_url;
   switch ($delta) {
     case 0:
-      if ($allowed_html = variable_get("allowed_html_$format", '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>')) {
+      if ($allowed_html = variable_get("allowed_html_$format")) {
         switch ($long) {
           case 0:
             return t('Allowed HTML tags: @tags', array('@tags' => $allowed_html));
           case 1:
             $output = '<p>' . t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) . '</p>';
-            if (!variable_get("filter_html_help_$format", 1)) {
+            if (!variable_get("filter_html_help_$format")) {
               return $output;
             }
 
             $output .= '<p>' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
             $output .= '<p>' . t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
             $tips = array(
-              'a' => array( t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . variable_get('site_name', 'Drupal') . '</a>'),
+              'a' => array( t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . variable_get('site_name') . '</a>'),
               'br' => array( t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with <br />line break')),
               'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . t('Paragraph one.') . '</p> <p>' . t('Paragraph two.') . '</p>'),
               'strong' => array( t('Strong'), '<strong>' . t('Strong') . '</strong>'),
@@ -302,7 +315,7 @@
 
     // Build query for selecting the format(s) based on the user's roles.
     if (!$all) {
-      $or = db_or()->condition('format', variable_get('filter_default_format', 1));
+      $or = db_or()->condition('format', variable_get('filter_default_format'));
       foreach ($user->roles as $rid => $role) {
         $or->condition('roles', '%'. (int)$rid .'%', 'LIKE');
       }
@@ -348,7 +361,7 @@
  * Resolve a format id, including the default format.
  */
 function filter_resolve_format($format) {
-  return $format == FILTER_FORMAT_DEFAULT ? variable_get('filter_default_format', 1) : $format;
+  return $format == FILTER_FORMAT_DEFAULT ? variable_get('filter_default_format') : $format;
 }
 /**
  * Check if text in a certain input format is allowed to be cached.
@@ -505,7 +518,7 @@
     // Only one format available: use a hidden form item and only show tips.
     $format = array_shift($formats);
     $form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents);
-    $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
+    $tips = _filter_tips(variable_get('filter_default_format'));
     $form['format']['guidelines'] = array(
       '#title' => t('Formatting guidelines'),
       '#markup' => theme('filter_tips', $tips, FALSE, $extra),
@@ -530,7 +543,7 @@
  */
 function filter_access($format) {
   $format = filter_resolve_format($format);
-  if (user_access('administer filters') || ($format == variable_get('filter_default_format', 1))) {
+  if (user_access('administer filters') || ($format == variable_get('filter_default_format'))) {
     return TRUE;
   }
   else {
@@ -660,7 +673,7 @@
   $form['filter_html']["allowed_html_$format"] = array(
     '#type' => 'textfield',
     '#title' => t('Allowed HTML tags'),
-    '#default_value' => variable_get("allowed_html_$format", '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>'),
+    '#default_value' => variable_get("allowed_html_$format"),
     '#size' => 64,
     '#maxlength' => 1024,
     '#description' => t('Specify a list of tags which should not be stripped. (Note that JavaScript event attributes are always stripped.)'),
@@ -668,13 +681,11 @@
   $form['filter_html']["filter_html_help_$format"] = array(
     '#type' => 'checkbox',
     '#title' => t('Display HTML help'),
-    '#default_value' => variable_get("filter_html_help_$format", 1),
     '#description' => t('If enabled, Drupal will display some basic HTML help in the long filter tips.'),
   );
   $form['filter_html']["filter_html_nofollow_$format"] = array(
     '#type' => 'checkbox',
     '#title' => t('Spam link deterrent'),
-    '#default_value' => variable_get("filter_html_nofollow_$format", FALSE),
     '#description' => t('If enabled, Drupal will add rel="nofollow" to all links, as a measure to reduce the effectiveness of spam links. Note: this will also prevent valid links from being followed by search engines, therefore it is likely most effective when enabled for anonymous users.'),
   );
   return $form;
@@ -684,10 +695,10 @@
  * HTML filter. Provides filtering of input into accepted HTML.
  */
 function _filter_html($text, $format) {
-  $allowed_tags = preg_split('/\s+|<|>/', variable_get("allowed_html_$format", '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>'), -1, PREG_SPLIT_NO_EMPTY);
+  $allowed_tags = preg_split('/\s+|<|>/', variable_get("allowed_html_$format"), -1, PREG_SPLIT_NO_EMPTY);
   $text = filter_xss($text, $allowed_tags);
 
-  if (variable_get("filter_html_nofollow_$format", FALSE)) {
+  if (variable_get("filter_html_nofollow_$format")) {
     $text = preg_replace('/<a([^>]+)>/i', '<a\\1 rel="nofollow">', $text);
   }
 
@@ -706,7 +717,6 @@
   $form['filter_urlfilter']['filter_url_length_' . $format] = array(
     '#type' => 'textfield',
     '#title' => t('Maximum link text length'),
-    '#default_value' => variable_get('filter_url_length_' . $format, 72),
     '#maxlength' => 4,
     '#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
   );
@@ -719,7 +729,7 @@
  */
 function _filter_url($text, $format) {
   // Pass length to regexp callback
-  _filter_url_trim(NULL, variable_get('filter_url_length_' . $format, 72));
+  _filter_url_trim(NULL, variable_get('filter_url_length_' . $format));
 
   $text = ' ' . $text . ' ';
 
@@ -1156,7 +1166,13 @@
 function filter_xss_bad_protocol($string, $decode = TRUE) {
   static $allowed_protocols;
   if (!isset($allowed_protocols)) {
-    $allowed_protocols = array_flip(variable_get('filter_allowed_protocols', array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'telnet', 'webcal')));
+    if (defined('MAINTENANCE_MODE')) {
+      $protocols = array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal');
+    }
+    else {
+      $protocols = variable_get('filter_allowed_protocols');
+    }
+    $allowed_protocols = array_flip($protocols);
   }
 
   // Get the plain text representation of the attribute value (i.e. its meaning).
Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.13
diff -u -r1.13 filter.admin.inc
--- modules/filter/filter.admin.inc	24 Jul 2008 16:27:51 -0000	1.13
+++ modules/filter/filter.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -28,7 +28,7 @@
         $roles[] = $name;
       }
     }
-    $default = ($id == variable_get('filter_default_format', 1));
+    $default = ($id == variable_get('filter_default_format'));
     $options[$id] = '';
     $form[$id]['name'] = array('#markup' => $format->name);
     $form[$id]['roles'] = array('#markup' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')));
@@ -36,7 +36,7 @@
     $form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id));
     $form[$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
   }
-  $form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format', 1));
+  $form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format'));
   $form['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
   return $form;
 }
@@ -108,7 +108,7 @@
  * @see filter_admin_format_form_submit()
  */
 function filter_admin_format_form(&$form_state, $format) {
-  $default = ($format->format == variable_get('filter_default_format', 1));
+  $default = ($format->format == variable_get('filter_default_format'));
   if ($default) {
     $help = t('All roles for the default format must be enabled and cannot be changed.');
     $form['default_format'] = array('#type' => 'hidden', '#value' => 1);
@@ -261,7 +261,7 @@
   $format = db_fetch_object(db_query('SELECT * FROM {filter_formats} WHERE format = %d', $format));
 
   if ($format) {
-    if ($format->format != variable_get('filter_default_format', 1)) {
+    if ($format->format != variable_get('filter_default_format')) {
       $form['format'] = array('#type' => 'hidden', '#value' => $format->format);
       $form['name'] = array('#type' => 'hidden', '#value' => $format->name);
 
@@ -284,7 +284,7 @@
   db_query("DELETE FROM {filter_formats} WHERE format = %d", $form_state['values']['format']);
   db_query("DELETE FROM {filters} WHERE format = %d", $form_state['values']['format']);
 
-  $default = variable_get('filter_default_format', 1);
+  $default = variable_get('filter_default_format');
   // Replace existing instances of the deleted format with the default format.
   db_query("UPDATE {node_revisions} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
   db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.652
diff -u -r1.652 comment.module
--- modules/comment/comment.module	27 Sep 2008 20:37:00 -0000	1.652
+++ modules/comment/comment.module	29 Sep 2008 22:13:56 -0000
@@ -91,6 +91,23 @@
 define('COMMENT_PREVIEW_REQUIRED', 1);
 
 /**
+ * Implementation of hook_variables().
+ */
+function comment_variables() {
+  return array(
+    'comment_block_count' => 10,
+    'node_cron_comments_scale' => 0,
+    'comment' => COMMENT_NODE_READ_WRITE,
+    'comment_default_mode' => COMMENT_MODE_THREADED_EXPANDED,
+    'comment_default_per_page' => 50,
+    'comment_anonymous' => COMMENT_ANONYMOUS_MAYNOT_CONTACT,
+    'comment_subject_field' => 1,
+    'comment_preview' => COMMENT_PREVIEW_REQUIRED,
+    'comment_form_location' => COMMENT_FORM_SEPARATE_PAGE,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function comment_help($path, $arg) {
@@ -264,7 +281,7 @@
       $form['comment_block_count'] = array(
         '#type' => 'select',
         '#title' => t('Number of recent comments'),
-        '#default_value' => variable_get('comment_block_count', 10),
+        '#default_value' => variable_get('comment_block_count'),
         '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
         '#description' => t('Number of comments displayed in the <em>Recent comments</em> block.'),
       );
@@ -376,7 +393,7 @@
  */
 function theme_comment_block() {
   $items = array();
-  $number = variable_get('comment_block_count', 10);
+  $number = variable_get('comment_block_count');
   foreach (comment_get_recent($number) as $comment) {
     $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->timestamp)));
   }
@@ -564,7 +581,7 @@
 
     case 'prepare':
       if (!isset($node->comment)) {
-        $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
+        $node->comment = variable_get("comment_$node->type");
       }
       break;
 
@@ -1280,7 +1297,7 @@
       '#title' => t('Your name'),
       '#maxlength' => 60,
       '#size' => 30,
-      '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')),
+      '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous'),
     );
     $form['mail'] = array(
       '#type' => 'textfield',
@@ -1303,7 +1320,7 @@
       '#title' => t('Your name'),
       '#maxlength' => 60,
       '#size' => 30,
-      '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')),
+      '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous'),
       '#required' => TRUE,
     );
     $form['mail'] = array(
@@ -1441,7 +1458,7 @@
       $comment->name = check_plain($account->name);
     }
     elseif (empty($comment->name)) {
-      $comment->name = variable_get('anonymous', t('Anonymous'));
+      $comment->name = variable_get('anonymous');
     }
 
     $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : REQUEST_TIME;
@@ -1704,7 +1721,7 @@
         $destination = 'destination=' . drupal_urlencode("node/$node->nid#comment-form");
       }
 
-      if (variable_get('user_register', 1)) {
+      if (variable_get('user_register')) {
         // Users can register themselves.
         return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination))));
       }
@@ -1989,7 +2006,7 @@
       'join' => 'LEFT JOIN {node_comment_statistics} node_comment_statistics ON node_comment_statistics.nid = i.sid',
       // Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
       'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * %f)',
-      'arguments' => array(variable_get('node_cron_comments_scale', 0)),
+      'arguments' => array(variable_get('node_cron_comments_scale')),
     ),
   );
 }
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.26
diff -u -r1.26 comment.install
--- modules/comment/comment.install	17 Sep 2008 07:11:56 -0000	1.26
+++ modules/comment/comment.install	29 Sep 2008 22:13:56 -0000
@@ -17,7 +17,7 @@
   db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', REQUEST_TIME, REQUEST_TIME);
 
   // Unstuck node indexing timestamp if needed.
-  if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) {
+  if (($last = variable_get('node_cron_last')) !== FALSE) {
     variable_set('node_cron_last', min(REQUEST_TIME, $last));
   }
 
Index: modules/color/color.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.module,v
retrieving revision 1.47
diff -u -r1.47 color.module
--- modules/color/color.module	20 Sep 2008 20:22:24 -0000	1.47
+++ modules/color/color.module	29 Sep 2008 22:13:56 -0000
@@ -2,6 +2,19 @@
 // $Id: color.module,v 1.47 2008/09/20 20:22:24 webchick Exp $
 
 /**
+ * Implementation of hook_variables().
+ */
+function color_variables() {
+  return array(
+    'color_screenshot' => NULL,
+    'color_stylesheets' => array(),
+    'color_logo' => NULL,
+    'color_palette' => array(),
+    'color_files' => array(),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function color_help($path, $arg) {
@@ -33,7 +46,7 @@
 function color_form_alter(&$form, $form_state, $form_id) {
   // Insert the color changer into the theme settings page.
   if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info')) {
-    if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) != FILE_DOWNLOADS_PUBLIC) {
+    if (variable_get('file_downloads') != FILE_DOWNLOADS_PUBLIC) {
       // Disables the color changer when the private download method is used.
       // TODO: This should be solved in a different way. See issue #181003.
       drupal_set_message(t('The color picker only works if the <a href="@url">download method</a> is set to public.', array('@url' => url('admin/settings/file-system'))), 'warning');
@@ -55,7 +68,7 @@
   if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') {
     $themes = list_themes();
     foreach (element_children($form) as $theme) {
-      if ($screenshot = variable_get('color_' . $theme . '_screenshot', NULL)) {
+      if ($screenshot = variable_get('color_screenshot_' . $theme)) {
         if (isset($form[$theme]['screenshot'])) {
           $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE);
         }
@@ -71,7 +84,7 @@
   global $language, $theme_key;
 
   // Override stylesheets.
-  $color_paths = variable_get('color_' . $theme_key . '_stylesheets', array());
+  $color_paths = variable_get('color_stylesheets_' . $theme_key);
   if (!empty($color_paths)) {
     // Loop over theme CSS files and try to rebuild CSS array with rewritten
     // stylesheets. Keep the orginal order intact for CSS cascading.
@@ -111,7 +124,7 @@
   }
 
   // Override logo.
-  $logo = variable_get('color_' . $theme_key . '_logo', NULL);
+  $logo = variable_get('color_logo_' . $theme_key);
   if ($logo && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) {
     $vars['logo'] = base_path() . $logo;
   }
@@ -142,7 +155,7 @@
   }
 
   // Load variable.
-  return $default ? $palette : variable_get('color_' . $theme . '_palette', $palette);
+  return $default ? $palette : variable_get('color_palette_' . $theme);
 }
 
 /**
@@ -164,7 +177,7 @@
   )), 'setting');
 
   // See if we're using a predefined scheme.
-  $current = implode(',', variable_get('color_' . $theme . '_palette', array()));
+  $current = implode(',', variable_get('color_palette_' . $theme));
   // Note: we use the original theme when the default scheme is chosen.
   $current = isset($info['schemes'][$current]) ? $current : ($current == '' ? reset($info['schemes']) : '');
 
@@ -270,7 +283,7 @@
   }
 
   // Delete old files.
-  foreach (variable_get('color_' . $theme . '_files', array()) as $file) {
+  foreach (variable_get('color_files_' . $theme) as $file) {
     @unlink($file);
   }
   if (isset($file) && $file = dirname($file)) {
Index: modules/simpletest/tests/bootstrap.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/bootstrap.test,v
retrieving revision 1.3
diff -u -r1.3 bootstrap.test
--- modules/simpletest/tests/bootstrap.test	15 Sep 2008 20:48:09 -0000	1.3
+++ modules/simpletest/tests/bootstrap.test	29 Sep 2008 22:13:57 -0000
@@ -133,20 +133,24 @@
    * testVariable
    */
   function testVariable() {
+    // Retrieving default values for variables.
+    $default_cron_key = 'drupal'; // The cron_key variable from System module.
+    $cron_key = variable_get('cron_key');
+    $this->assertIdentical($cron_key, $default_cron_key, t('Retrieving default values for variables'));
+    
     // Setting and retrieving values.
     $variable = $this->randomName();
     variable_set('simpletest_bootstrap_variable_test', $variable);
-    $this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test', NULL), t('Setting and retrieving values'));
+    $this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test'), t('Setting and retrieving values'));
 
     // Make sure the variable persists across multiple requests.
     $this->drupalGet('system-test/variable-get');
     $this->assertText($variable, t('Variable persists across multiple requests'));
 
     // Deleting variables.
-    $default_value = $this->randomName();
     variable_del('simpletest_bootstrap_variable_test');
-    $variable = variable_get('simpletest_bootstrap_variable_test', $default_value);
-    $this->assertIdentical($variable, $default_value, t('Deleting variables'));
+    $variable = variable_get('simpletest_bootstrap_variable_test');
+    $this->assertIdentical($variable, NULL, t('Deleting variables'));
   }
 
 }
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.13
diff -u -r1.13 profile.install
--- modules/profile/profile.install	15 Mar 2008 12:31:29 -0000	1.13
+++ modules/profile/profile.install	29 Sep 2008 22:13:56 -0000
@@ -15,8 +15,6 @@
 function profile_uninstall() {
   // Remove tables
   drupal_uninstall_schema('profile');
-
-  variable_del('profile_block_author_fields');
 }
 
 /**
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.244
diff -u -r1.244 profile.module
--- modules/profile/profile.module	5 Sep 2008 09:25:52 -0000	1.244
+++ modules/profile/profile.module	29 Sep 2008 22:13:56 -0000
@@ -27,6 +27,15 @@
 define('PROFILE_HIDDEN', 4);
 
 /**
+ * Implementation of hook_variables().
+ */
+function profile_variables() {
+  return array(
+    'profile_block_author_fields' => array(),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function profile_help($path, $arg) {
@@ -146,7 +155,7 @@
     $form['profile_block_author_fields'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Profile fields to display'),
-      '#default_value' => variable_get('profile_block_author_fields', array()),
+      '#default_value' => variable_get('profile_block_author_fields'),
       '#options' => $fields,
       '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/user/profile'))),
     );
@@ -162,7 +171,7 @@
         $node = node_load(arg(1));
         $account = user_load(array('uid' => $node->uid));
 
-        if ($use_fields = variable_get('profile_block_author_fields', array())) {
+        if ($use_fields = variable_get('profile_block_author_fields')) {
           // Compile a list of fields to show.
           $fields = array();
           $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
@@ -261,7 +270,7 @@
       case 'url':
         return '<a href="' . check_url($value) . '">' . check_plain($value) . '</a>';
       case 'date':
-        $format = substr(variable_get('date_format_short', 'm/d/Y - H:i'), 0, 5);
+        $format = substr(variable_get('date_format_short'), 0, 5);
         // Note: Avoid PHP's date() because it does not handle dates before
         // 1970 on Windows. This would make the date field useless for e.g.
         // birthdays.
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.29
diff -u -r1.29 openid.module
--- modules/openid/openid.module	17 Sep 2008 07:11:57 -0000	1.29
+++ modules/openid/openid.module	29 Sep 2008 22:13:56 -0000
@@ -63,7 +63,7 @@
 function openid_user($op, &$edit, &$account, $category = NULL) {
   if ($op == 'insert' && isset($_SESSION['openid']['values'])) {
     // The user has registered after trying to login via OpenID.
-    if (variable_get('user_email_verification', TRUE)) {
+    if (variable_get('user_email_verification')) {
       drupal_set_message(t('Once you have verified your email address, you may log in via OpenID.'));
     }
     unset($_SESSION['openid']);
@@ -118,7 +118,7 @@
     $form['mail']['#default_value'] = $_SESSION['openid']['values']['mail'];
     // If user_email_verification is off, hide the password field and just fill
     // with random password to avoid confusion.
-    if (!variable_get('user_email_verification', TRUE)) {
+    if (!variable_get('user_email_verification')) {
       $form['pass']['#type'] = 'hidden';
       $form['pass']['#value'] = user_password();
     }
@@ -387,20 +387,20 @@
 
   $account = user_external_load($identity);
   if (isset($account->uid)) {
-    if (!variable_get('user_email_verification', TRUE) || $account->login) {
+    if (!variable_get('user_email_verification') || $account->login) {
       user_external_login($account, $_SESSION['openid']['user_login_values']);
     }
     else {
       drupal_set_message(t('You must validate your email address for this account before logging in via OpenID'));
     }
   }
-  elseif (variable_get('user_register', 1)) {
+  elseif (variable_get('user_register')) {
     // Register new user
     $form_state['redirect'] = NULL;
     $form_state['values']['name'] = (empty($response['openid.sreg.nickname'])) ? $identity : $response['openid.sreg.nickname'];
     $form_state['values']['mail'] = (empty($response['openid.sreg.email'])) ? '' : $response['openid.sreg.email'];
     $form_state['values']['pass']  = user_password();
-    $form_state['values']['status'] = variable_get('user_register', 1) == 1;
+    $form_state['values']['status'] = variable_get('user_register') == 1;
     $form_state['values']['response'] = $response;
     $form = drupal_retrieve_form('user_register', $form_state);
     drupal_prepare_form('user_register', $form, $form_state);
Index: modules/path/path.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v
retrieving revision 1.10
diff -u -r1.10 path.admin.inc
--- modules/path/path.admin.inc	21 Aug 2008 19:36:37 -0000	1.10
+++ modules/path/path.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -97,7 +97,7 @@
     '#maxlength' => 64,
     '#size' => 45,
     '#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'),
-    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
+    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q='),
     '#required' => TRUE,
   );
   $form['dst'] = array(
@@ -107,7 +107,7 @@
     '#maxlength' => 64,
     '#size' => 45,
     '#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
-    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
+    '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q='),
     '#required' => TRUE,
   );
   // This will be a hidden value unless locale module is enabled
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.310
diff -u -r1.310 block.module
--- modules/block/block.module	27 Sep 2008 19:47:42 -0000	1.310
+++ modules/block/block.module	29 Sep 2008 22:13:56 -0000
@@ -61,6 +61,15 @@
 define('BLOCK_CACHE_GLOBAL', 0x0008);
 
 /**
+ * Implementation of hook_variables().
+ */
+function block_variables() {
+  return array(
+    'block_cache' => CACHE_DISABLED,
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
 function block_help($path, $arg) {
@@ -152,7 +161,7 @@
     'access arguments' => array('administer blocks'),
     'type' => MENU_LOCAL_TASK,
   );
-  $default = variable_get('theme_default', 'garland');
+  $default = variable_get('theme_default');
   foreach (list_themes() as $key => $theme) {
     $items['admin/build/block/list/' . $key] = array(
       'title' => check_plain($theme->info['name']),
@@ -170,7 +179,7 @@
  * Menu item access callback - only admin or enabled themes can be accessed.
  */
 function _block_themes_access($theme) {
-  return user_access('administer blocks') && ($theme->status || $theme->name == variable_get('admin_theme', '0'));
+  return user_access('administer blocks') && ($theme->status || $theme->name == variable_get('admin_theme'));
 }
 
 /**
@@ -530,7 +539,7 @@
   // it brings too many chances of having unwanted output get in the cache
   // and later be served to other users. We therefore exclude user 1 from
   // block caching.
-  if (variable_get('block_cache', 0) && $block->cache != BLOCK_NO_CACHE && $user->uid != 1) {
+  if (variable_get('block_cache') && $block->cache != BLOCK_NO_CACHE && $user->uid != 1) {
     $cid_parts = array();
 
     // Start with common sub-patterns: block identification, theme, language.
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.19
diff -u -r1.19 block.admin.inc
--- modules/block/block.admin.inc	16 Jul 2008 21:59:25 -0000	1.19
+++ modules/block/block.admin.inc	29 Sep 2008 22:13:56 -0000
@@ -13,7 +13,7 @@
   global $custom_theme;
 
   // If non-default theme configuration has been selected, set the custom theme.
-  $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
+  $custom_theme = isset($theme) ? $theme : variable_get('theme_default');
 
   // Fetch and sort blocks.
   $blocks = _block_rehash();
@@ -31,7 +31,7 @@
   drupal_add_css(drupal_get_path('module', 'block') . '/block.css', 'module', 'all', FALSE);
 
   // If non-default theme configuration has been selected, set the custom theme.
-  $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
+  $custom_theme = isset($theme) ? $theme : variable_get('theme_default');
   init_theme();
 
   $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
