From ed1d212ae2daea5e4bd043417610177093e99f19 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 16 Jan 2016 03:03:51 -0500
Subject: [PATCH] Improved SVG cleanup code
---
program/include/rcmail_utils.php | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/program/include/rcmail_utils.php b/program/include/rcmail_utils.php
index cc2ff73..6de4f18 100644
--- a/program/include/rcmail_utils.php
+++ b/program/include/rcmail_utils.php
@@ -1,6 +1,6 @@
<?php
-/*
+/**
+-----------------------------------------------------------------------+
| program/include/rcmail_utils.php |
| |
@@ -327,8 +327,9 @@
* @param string Option name
* @param string Option value
* @param int Optional user identifier
+ * @param string Optional value type (bool, int, string)
*/
- public static function mod_pref($name, $value, $userid = null)
+ public static function mod_pref($name, $value, $userid = null, $type = 'string')
{
$db = self::db();
@@ -339,6 +340,15 @@
$query = '1=1';
}
+ $type = strtolower($type);
+
+ if ($type == 'bool' || $type == 'boolean') {
+ $value = rcube_utils::get_boolean($value);
+ }
+ else if ($type == 'int' || $type == 'integer') {
+ $value = (int) $value;
+ }
+
// iterate over all users
$sql_result = $db->query("SELECT * FROM " . $db->table_name('users', true) . " WHERE $query");
--
Gitblit v1.9.1