changeset 72:63a6caf59e5c

Fix creation of boolean settings, and add '%b' formatter into stPrepareSQL().
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 17 Oct 2013 15:01:20 +0300
parents d74fb8cf0062
children c70c2650f790
files createdb.php msite.inc.php
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/createdb.php	Fri Oct 11 09:33:16 2013 +0300
+++ b/createdb.php	Thu Oct 17 15:01:20 2013 +0300
@@ -215,7 +215,7 @@
     {
       case VT_TEXT: $type = "%s"; $var = "vtext"; break;
       case VT_STR:  $type = "%s"; $var = "vstr"; break;
-      case VT_BOOL: $type = "%B"; $var = "vint"; break;
+      case VT_BOOL: $type = "%b"; $var = "vint"; break;
       case VT_INT:  $type = "%d"; $var = "vint"; break;
     }
 
--- a/msite.inc.php	Fri Oct 11 09:33:16 2013 +0300
+++ b/msite.inc.php	Thu Oct 17 15:01:20 2013 +0300
@@ -268,6 +268,9 @@
     case "s":
       return $db->quote($value);
 
+    case "b":
+      return intval($value) ? 1 : 0;
+
     case "D":
       return intval(stGetRequestItem($value));