2 commits - lib/kolab_client_task.php lib/kolab_utils.php public_html/skins
Aleksander Machniak
machniak at kolabsys.com
Fri Oct 10 20:08:52 CEST 2014
lib/kolab_client_task.php | 2 +-
lib/kolab_utils.php | 17 +++++++++++++++++
public_html/skins/default/style.css | 4 ++++
3 files changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 1e9c4d1a80785895294a4503517fb51dfa2d8d70
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Fri Oct 10 20:07:36 2014 +0200
Define max-width for select fields
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index fcb47e5..2452eaf 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -120,6 +120,10 @@ table.form td {
padding: 1px 5px;
}
+table.form select {
+ max-width: 500px;
+}
+
table.form tr.required input,
table.form tr.required select,
table.form tr.required textarea {
commit 3b4e4a7d263df3a864e542970dc27c21bd92bf97
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Fri Oct 10 20:02:16 2014 +0200
Fix escaping of object identifiers in javascript command (#3675)
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 1fe3761..5713a5b 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -1682,7 +1682,7 @@ class kolab_client_task
$i++;
$cells = array();
$cells[] = array('class' => 'name', 'body' => kolab_html::escape($item),
- 'onclick' => "kadm.command('$task.info', '$idx')");
+ 'onclick' => "kadm.command('$task.info', '" . kolab_utils::js_escape($idx) . "')");
$rows[] = array('id' => $i, 'class' => implode(' ', $class), 'cells' => $cells);
}
}
diff --git a/lib/kolab_utils.php b/lib/kolab_utils.php
index e2602af..91dad55 100644
--- a/lib/kolab_utils.php
+++ b/lib/kolab_utils.php
@@ -206,4 +206,21 @@ class kolab_utils
return $str;
}
+
+ /**
+ * Escape string for use in javascript code
+ *
+ * @param string $str String
+ *
+ * @return string Escaped string
+ */
+ public static function js_escape($str)
+ {
+ return strtr($str, array(
+ '"' => '\\"',
+ "'" => "\\'",
+ "\\" => "\\\\",
+ "\n" => '\n',
+ ));
+ }
}
More information about the commits
mailing list