From 39f883e1f9fab83a47b76fb4802c2d01fa9c4e76 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Tue, 27 Nov 2012 12:13:07 -0500
Subject: [PATCH] Unset mime-magic location in order to let PHP use the default location

---
 program/include/html.php |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/program/include/html.php b/program/include/html.php
index ba70981..8d0996e 100644
--- a/program/include/html.php
+++ b/program/include/html.php
@@ -6,7 +6,10 @@
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
- | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | Licensed under the GNU General Public License version 3 or            |
+ | any later version with exceptions for skins & plugins.                |
+ | See the README file for a full license statement.                     |
  |                                                                       |
  | PURPOSE:                                                              |
  |   Helper class to create valid XHTML code                             |
@@ -154,7 +157,7 @@
             $attr = array('src' => $attr);
         }
         return self::tag('img', $attr + array('alt' => ''), null, array_merge(self::$common_attrib,
-	    array('src','alt','width','height','border','usemap')));
+	        array('src','alt','width','height','border','usemap','onclick')));
     }
 
     /**
@@ -298,7 +301,7 @@
                 $attrib_arr[] = $key . '="' . Q($value, 'strict', false) . '"';
             }
             else {
-                $attrib_arr[] = $key . '="' . Q($value) . '"';
+                $attrib_arr[] = $key . '="' . htmlspecialchars($value, ENT_COMPAT, RCMAIL_CHARSET) . '"';
             }
         }
         return count($attrib_arr) ? ' '.implode(' ', $attrib_arr) : '';
@@ -314,9 +317,10 @@
 {
     protected $tagname = 'input';
     protected $type = 'text';
-    protected $allowed = array('type','name','value','size','tabindex',
-	'autocomplete','checked','onchange','onclick','disabled','readonly',
-	'spellcheck','results','maxlength','src','multiple');
+    protected $allowed = array(
+        'type','name','value','size','tabindex','autocapitalize',
+        'autocomplete','checked','onchange','onclick','disabled','readonly',
+        'spellcheck','results','maxlength','src','multiple','placeholder');
 
     /**
      * Object constructor
@@ -331,10 +335,6 @@
 
         if ($attrib['type']) {
             $this->type = $attrib['type'];
-        }
-
-        if ($attrib['newline']) {
-            $this->newline = true;
         }
     }
 
@@ -378,11 +378,12 @@
  * @package HTML
  */
 
-class html_hiddenfield extends html_inputfield
+class html_hiddenfield extends html
 {
+    protected $tagname = 'input';
     protected $type = 'hidden';
     protected $fields_arr = array();
-    protected $newline = true;
+    protected $allowed = array('type','name','value','onchange','disabled','readonly');
 
     /**
      * Constructor
@@ -642,9 +643,9 @@
         $cell->content = $cont;
 
         $this->rows[$this->rowindex]->cells[$this->colindex] = $cell;
-        $this->colindex++;
+        $this->colindex += max(1, intval($attr['colspan']));
 
-        if ($this->attrib['cols'] && $this->colindex == $this->attrib['cols']) {
+        if ($this->attrib['cols'] && $this->colindex >= $this->attrib['cols']) {
             $this->add_row();
         }
     }

--
Gitblit v1.9.1