Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.148
diff -u -9 -p -r1.148 install.php
--- install.php	6 Jan 2009 13:23:54 -0000	1.148
+++ install.php	15 Jan 2009 16:05:59 -0000
@@ -548,21 +548,23 @@ function install_select_locale($profilen
       if (isset($details['language'])) {
         foreach ($locales as $locale) {
           if ($details['language'] == $locale->name) {
             return $locale->name;
           }
         }
       }
     }
 
-    foreach ($locales as $locale) {
-      if ($_POST['locale'] == $locale->name) {
-        return $locale->name;
+    if (!empty($_POST['locale'])) {
+      foreach ($locales as $locale) {
+        if ($_POST['locale'] == $locale->name) {
+          return $locale->name;
+        }
       }
     }
 
     install_task_list('locale-select');
 
     drupal_set_title(st('Choose language'));
     print theme('install_page', drupal_get_form('install_select_locale_form', $locales));
     exit;
   }
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.264
diff -u -9 -p -r1.264 bootstrap.inc
--- includes/bootstrap.inc	14 Jan 2009 12:15:38 -0000	1.264
+++ includes/bootstrap.inc	15 Jan 2009 16:05:59 -0000
@@ -224,18 +224,28 @@ define('REGISTRY_RESET_LOOKUP_CACHE', 1)
  */
 define('REGISTRY_WRITE_LOOKUP_CACHE', 2);
 
 /**
  * @} End of "Title text filtering flags".
  */
 
 
 /**
+ * Language written left to right. Possible value of $language->direction.
+ */
+define('LANGUAGE_LTR', 0);
+
+/**
+ * Language written right to left. Possible value of $language->direction.
+ */
+define('LANGUAGE_RTL', 1);
+
+/**
  * Start the timer with the specified name. If you start and stop
  * the same timer multiple times, the measured intervals will be
  * accumulated.
  *
  * @param name
  *   The name of the timer.
  */
 function timer_start($name) {
   global $timers;
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.848
diff -u -9 -p -r1.848 common.inc
--- includes/common.inc	14 Jan 2009 21:13:41 -0000	1.848
+++ includes/common.inc	15 Jan 2009 16:05:59 -0000
@@ -2039,19 +2039,19 @@ function drupal_add_css($path = NULL, $o
     $type = $options['type'];
 
     // This check is necessary to ensure proper cascading of styles and is faster than an asort().
     if (!isset($css[$media])) {
       $css[$media] = array('module' => array(), 'theme' => array());
     }
     $css[$media][$type][$path] = $options['preprocess'];
 
     // If the current language is RTL, add the CSS file with RTL overrides.
-    if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
+    if ($language->direction == LANGUAGE_RTL) {
       $rtl_path = str_replace('.css', '-rtl.css', $path);
       if (file_exists($rtl_path)) {
         $css[$media][$type][$rtl_path] = $options['preprocess'];
       }
     }
   }
 
   return $css;
 }
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.483
diff -u -9 -p -r1.483 book.module
--- modules/book/book.module	29 Dec 2008 16:03:56 -0000	1.483
+++ modules/book/book.module	15 Jan 2009 16:06:00 -0000
@@ -992,19 +992,19 @@ function book_toc($bid, $exclude = array
  *
  * @see book-export-html.tpl.php
  */
 function template_preprocess_book_export_html(&$variables) {
   global $base_url, $language;
 
   $variables['title'] = check_plain($variables['title']);
   $variables['base_url'] = $base_url;
   $variables['language'] = $language;
-  $variables['language_rtl'] = defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL;
+  $variables['language_rtl'] = $language->direction == LANGUAGE_RTL;
   $variables['head'] = drupal_get_html_head();
 }
 
 /**
  * Traverse the book tree to build printable or exportable output.
  *
  * During the traversal, the $visit_func() callback is applied to each
  * node, and is called recursively for each child of the node (in weight,
  * title order).
Index: modules/color/color.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.module,v
retrieving revision 1.51
diff -u -9 -p -r1.51 color.module
--- modules/color/color.module	30 Dec 2008 16:43:16 -0000	1.51
+++ modules/color/color.module	15 Jan 2009 16:06:00 -0000
@@ -88,19 +88,19 @@ function _color_page_alter(&$vars) {
         // Color module currently requires unique file names to be used,
         // which allows us to compare different file paths.
         if (basename($old_path) == basename($color_path)) {
           // Pull out the non-colored and add rewritten stylesheet.
           unset($new_theme_css[$old_path]);
           $new_theme_css[$color_path] = $old_preprocess;
 
           // If the current language is RTL and the CSS file had an RTL variant,
           // pull out the non-colored and add rewritten RTL stylesheet.
-          if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
+          if ($language->direction == LANGUAGE_RTL) {
             $rtl_old_path = str_replace('.css', '-rtl.css', $old_path);
             $rtl_color_path = str_replace('.css', '-rtl.css', $color_path);
             if (file_exists($rtl_color_path)) {
               unset($new_theme_css[$rtl_old_path]);
               $new_theme_css[$rtl_color_path] = $old_preprocess;
             }
           }
           break;
         }
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.234
diff -u -9 -p -r1.234 locale.module
--- modules/locale/locale.module	16 Dec 2008 23:57:32 -0000	1.234
+++ modules/locale/locale.module	15 Jan 2009 16:06:00 -0000
@@ -6,29 +6,18 @@
  *   Add language handling functionality and enables the translation of the
  *   user interface to languages other than English.
  *
  *   When enabled, multiple languages can be set up. The site interface
  *   can be displayed in different languages, as well as nodes can have languages
  *   assigned. The setup of languages and translations is completely web based.
  *   Gettext portable object files are supported.
  */
 
-/**
- * Language written left to right. Possible value of $language->direction.
- */
-define('LANGUAGE_LTR', 0);
-
-/**
- * Language written right to left. Possible value of $language->direction.
- */
-define('LANGUAGE_RTL', 1);
-
-
 // ---------------------------------------------------------------------------------
 // Hook implementations
 
 /**
  * Implementation of hook_help().
  */
 function locale_help($path, $arg) {
   switch ($path) {
     case 'admin/help#locale':
Index: themes/garland/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/template.php,v
retrieving revision 1.19
diff -u -9 -p -r1.19 template.php
--- themes/garland/template.php	25 Jun 2008 09:12:25 -0000	1.19
+++ themes/garland/template.php	15 Jan 2009 16:06:00 -0000
@@ -86,15 +86,15 @@ function garland_node_submitted($node) {
 }
 
 /**
  * Generates IE CSS links for LTR and RTL languages.
  */
 function garland_get_ie_styles() {
   global $language;
 
   $ie_styles = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . path_to_theme() . '/fix-ie.css" />'. "\n";
-  if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
+  if ($language->direction == LANGUAGE_RTL) {
     $ie_styles .= '      <style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/fix-ie-rtl.css";</style>'. "\n";
   }
 
   return $ie_styles;
 }
