From 3a54013de515df327f8909983732500fdde122b8 Mon Sep 17 00:00:00 2001
From: Pieter Frenssen <pieter@frenssen.be>
Date: Tue, 1 Jan 2013 19:29:48 +0100
Subject: [PATCH] Issue #608826 by pfrenssen: Fixed Install breaks with
 javascript disabled if has_js cookie is set.

---
 includes/install.core.inc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/includes/install.core.inc b/includes/install.core.inc
index 7a694e9..28205ae 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -211,6 +211,14 @@ function install_begin_request(&$install_state) {
   // Add any installation parameters passed in via the URL.
   $install_state['parameters'] += $_GET;
 
+  // If the user switches from JS to non-JS the 'has_js'-cookie will stay
+  // behind and will prevent the installation from completing successfully. We
+  // delete this cookie at the start of the installation process.
+  if (empty($install_state['parameters']) && isset($_COOKIE['has_js'])) {
+    setcookie('has_js', '', time() - 3600, '/');
+    unset($_COOKIE['has_js']);
+  }
+
   // Validate certain core settings that are used throughout the installation.
   if (!empty($install_state['parameters']['profile'])) {
     $install_state['parameters']['profile'] = preg_replace('/[^a-zA-Z_0-9]/', '', $install_state['parameters']['profile']);
-- 
1.8.0.3

